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

Mike Klaas mike.klaas at gmail.com
Wed Feb 14 03:33:07 CET 2007


On 2/13/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Mike Klaas wrote:
>
> > As a comparison, enumerate (that I would have believed was much more
> > frequent a priori), is used 67 times, and zip/izip 165 times.
>
> By that argument, we should be considering a special syntax
> for zip and izip before getattr.

I don't really buy that.  Frequency of use must be balanced against
the improvement in legibility.  Assuming that my figures bear some
correspondence to typical usage patterns, enumerate() was introduced
despite the older idiom of for i, item in zip(xrange(len(seq)), seq):
being less frequent than getattr.  SImilarly, I see no clamor to add
syntactic support for len().  It's current usage is clear.

[note: this post is not continuing to argue in favour of the proposal]

-Mike


More information about the Python-Dev mailing list