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/2007-February/071055.html below:

[Python-Dev] Summary of "dynamic attribute access" discussion

[Python-Dev] Summary of "dynamic attribute access" discussion [Python-Dev] Summary of "dynamic attribute access" discussionAahz aahz at pythoncraft.com
Tue Feb 13 20:13:08 CET 2007
On Tue, Feb 13, 2007, Ben North wrote:
>
> I think the "obj.[attr_name]" syntax has the most support.  To stop this
> going round in circles for ages, then, I will take this as the winner.
> I'll mention the other contenders in the PEP, including the new
> "visually distinctive" suggestions
> 
>    obj@[foo]
>    obj.[[foo]]
> 
> and the "wrapper class" idea of Nick Coghlan:
> 
>    attrview(obj)[foo]

For most cases where this is needed, why not just use a mixin class?
That works perfectly well with current Python and doesn't even look
funny:

    obj[foo] = blah
    print obj[foo]

My company makes heavy use of this coding style, we can use obj.foo
whenever appropriate.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I disrespectfully agree."  --SJM
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