[Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)

Adam Olsen rhamph at gmail.com
Mon Dec 12 13:49:10 CET 2005


[Quotations deleted since I'm not replying to anything directly]

When I need an identifier unique to a class I just use a reference to
the class itself.  As such I'd like to suggest that
obj.__private
be converted to
obj.__dict__[(type(obj), '__private')]

Note that I'm accessing __dict__ directly so as to avoid getattr's
requirement for attribute names to be strings.

Obviously it doesn't handle backwards compatibility, so it's more of a
"if I could do it again.." suggestion.

--
Adam Olsen, aka Rhamphoryncus


More information about the Python-Dev mailing list