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/071060.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" discussionskip at pobox.com skip at pobox.com
Tue Feb 13 21:13:44 CET 2007
    Mike> Another data point: on our six-figure loc code base, we have 123
    Mike> instances of getattr, 30 instances of setattr, and 0 instances of
    Mike> delattr.  There are 5 instances of setattr( ... getattr( ... ) )
    Mike> on one line (and probably a few more that grep didn't pick up that
    Mike> span multiple lines).

    Mike> As a comparison, enumerate (that I would have believed was much
    Mike> more frequent a priori), is used 67 times, and zip/izip 165 times.

But (get|set|has)attr has been around much longer than enumerate.  I'm
almost certain they existed in 1.5, and perhaps as far back as 1.0.  If you
really want to compare the two, go back to your code baseline before
enumerate was added to Python (2.3?) and subtract from your counts all the
*attr calls that existed then and then compare the adjusted counts with
enumerate.

Given that you have more uses of zip/izip maybe we should be discussion
syntactic support for that instead. ;-)

    Mike> +1 on .[] notation and the idea in general.

Skip
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