Need Help with Encapsulation in Python!

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri Jun 17 14:14:57 UTC 2022


On Friday, 17 June 2022 at 13:58:15 UTC, Soham Mukherjee wrote:
> Is there any better way to achieve encapsulation in Python? 
> Please rectify my code if possible.

One convention is to use "self._fieldname" for protected and 
"self.__fieldname" for private class attributes.




More information about the Digitalmars-d-learn mailing list