General question about Python design goals

Donn Cave donn at drizzle.com
Sat Dec 3 00:49:02 EST 2005


Quoth Mike Meyer <mwm at mired.org>:
| Donn Cave <donn at u.washington.edu> writes:
...
|> For me, conceptually, if an object can't be accessed
|> sequentially, then it can't be mapped to a sequence.
|
| So you're saying that for should implicitly invoke list (or maybe
| iter) on any object that it's passed that's not a list or iterator?

Not really saying anything so concrete about it -- doesn't make
any difference to me how it works, just saying that all these
things come together.  Convert to list, iterate, for.  They're
conceptually not just related, but bound together.

|> 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.
|
| If you do that, you've just weakened the case for not having count
| etc. as methods of tuples.
|
| It really is the dichotomy of "tuples aren't meant to be sequences so
| they don't have ..." versus being able to access them sequentially
| that gets me. That just doesn't seem right.

The case is weakened only if we have been pretending it was really
strong.  I guess this may be why this issue drives certain people
crazy.  There's a case for "don't have", but it isn't air-tight, so
what do we do?  Well, that's the one thing I really like about the
winter holiday season -- some particularly flavorful ales come out
of the local micro-breweries around this time of year, just in time
to ease my worries about tuples.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list