Change "__propertyName" or "__functionName" as invisible parts in a class forcely

2026-05-26 Thread wei . tung
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

Forcely make "private method or property" invisble and cannot be accessed directly

2026-05-26 Thread WeiTung
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

ANN: Python Meeting Düsseldorf - 03.06.2026

2026-05-26 Thread eGenix Team
/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

Re: Change "__propertyName" or "__functionName" as invisible parts in a class forcely

2026-05-26 Thread Chris Angelico via Python-list
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

Re: Change "__propertyName" or "__functionName" as invisible parts in a class forcely

2026-05-26 Thread Chris Angelico via Python-list
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

Re: Change "__propertyName" or "__functionName" as invisible parts in a class forcely

2026-05-26 Thread Gregg Drennan via Python-list
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