General question about Python design goals

Donn Cave donn at u.washington.edu
Thu Dec 1 15:46:35 EST 2005


In article <86k6epl12q.fsf at bhuda.mired.org>, Mike Meyer <mwm at mired.org> 
wrote:
...
> So why the $*@& (please excuse my Perl) does "for x in 1, 2, 3" work?
> 
> Seriously. Why doesn't this have to be phrased as "for x in list((1,
> 2, 3))", just like you have to write list((1, 2, 3)).count(1), etc.?

How could list(t) work, if for x in t didn't?
For me, conceptually, if an object can't be accessed
sequentially, then it can't be mapped to a sequence.

Anyway, it seems to me that in the end this is about
that balance between practicality and purity.  Maybe
it's more like tuples have a primary intended purpose,
and some support for other applications.  Not white,
but not pure black either.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list