As u all know, when we're starting to define a private member or a function in
Python, led by "__", some like this following:
class MyClass:
__privateMember = your initValue Here
def __myPrivateMethod(self):
# do what u want here...
Now you can still access the private member o
Hello all:
Until now we see if you have a class like this following in Python
class MyClass:
__myPrivateMember = 0
def __myPrivateMethod(self):
# Here goes with what you want freely
pass
mc
/This announcement is in German since it targets a local user
group//meeting in Düsseldorf, Germany
/
Über uns
Python Meeting Düsseldorf - Ein Treffen von Python Enthusiasten und
Interessierten in ungezwungener Atmosphäre
*A special note to our English speaking friends: Presentations
On Wed, 27 May 2026 at 04:16, wrote:
>
> As u all know, when we're starting to define a private member or a function
> in Python, led by "__", some like this following:
>
> class MyClass:
>
> __privateMember = your initValue Here
>
> def __myPrivateMethod(self):
> # do what u want
On Wed, 27 May 2026 at 05:57, Gregg Drennan wrote:
> Starting a class method or properly with a double-underscore causes "name
> mangling" which kind of hides the name, but not really.
>
More specifically, the name mangling is not intended to hide anything,
but to allow classes in a hierarchy to
Chris' response is dead on. Python was never designed or intended to have
private variables, methods or classes, like many other languages do.
Starting a name with an underscore is a well documented
construct/understanding/standard meaning not to use this directly but
instead use the "public" met