This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients Leeland Morgan, xtreak
Date 2018-07-24.13:13:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532437999.78.0.56676864532.issue34196@psf.upfronthosting.co.za>
In-reply-to
Content
I think below doc gives some indication that it always occurs within the definition of the class (hence inside a static method) irrespective of the syntactic position for any valid identifier and hence for class __SuperPrivateClass too. I will let others explain on this better or give more information.

https://docs.python.org/3/tutorial/classes.html#private-variables (second paragraph)

Since there is a valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses), there is limited support for such a mechanism, called name mangling. Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with _classname__spam, where classname is the current class name with leading underscore(s) stripped. This mangling is done without regard to the syntactic position of the identifier, as long as it occurs within the definition of a class.

SO answer that gave me the link : https://stackoverflow.com/a/1301369/2610955

Thanks
History
Date User Action Args
2018-07-24 13:13:19xtreaksetrecipients: + xtreak, Leeland Morgan
2018-07-24 13:13:19xtreaksetmessageid: <1532437999.78.0.56676864532.issue34196@psf.upfronthosting.co.za>
2018-07-24 13:13:19xtreaklinkissue34196 messages
2018-07-24 13:13:19xtreakcreate