A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-December/058591.html below:

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

[Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications) [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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4