Re: Python 3000, zip, *args and iterators

2004-12-29 Thread Steven Bethard
Raymond Hettinger wrote: [Steven Bethard] I'm just suggesting that in a function with a *args in the def, the args variable be an iterator instead of a tuple. So people would lose the useful abilities to check len(args) or extract an argument with args[1]? No more than you lose these abilities wi

Re: Python 3000, zip, *args and iterators

2004-12-29 Thread Raymond Hettinger
[Steven Bethard] I'm just suggesting that in a function with a > *args in the def, the args variable be an iterator instead of > a tuple. So people would lose the useful abilities to check len(args) or extract an argument with args[1]? Besides, if a function really wants an iterator, then its si

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Steven Bethard
Raymond Hettinger wrote: [Steven Bethard] What I would prefer is something like: >>> zip(*g(4)) >>> x, y, z = zip(*g(4)) >>> x, y, z (, at ...) 2. It is instructive to look at Guido's reactions to other *args proposals. His receptivity to a,b,*c=it wanes whenever someone then requests support fo

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Steve Holden
Raymond Hettinger wrote: [...] "Not everything that can be done, should be done." ... and not everything that should be done, can be done. regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Alex Martelli
Raymond Hettinger <[EMAIL PROTECTED]> wrote: ... > "Not everything that can be done, should be done." Or, to quote Scripture...: "'Everything is permissible for me' -- but not everything is beneficial" (1 Cor 6:12)... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Raymond Hettinger
[Steven Bethard] > What I would prefer is something like: > > >>> zip(*g(4)) > > >>> x, y, z = zip(*g(4)) > >>> x, y, z > (, So I guess my real question is, should I expect Python 3000 to play > nicely with *args and iterators? Are there reasons (besides backwards > incompatibility) that pars

Re: Python 3000, zip, *args and iterators

2004-12-26 Thread Steven Bethard
Terry Reedy wrote: "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I guess the point of my question is to find out if this kind of nice interaction of *args and iterators is something that's in the road-map. If it is, then maybe there are parts of it that could be i

Re: Python 3000, zip, *args and iterators

2004-12-26 Thread Terry Reedy
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: >> I think it worth repeating that Python 3 is at yet something of a >> pipedream, as indicated by the joke name Python 3000 > Right, though my understanding of PEP 3000[1] is that though "Python

Re: Python 3000, zip, *args and iterators

2004-12-26 Thread Steven Bethard
Terry Reedy wrote: "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] So, as I understand it, in Python 3000, zip will basically be replaced with izip, meaning that instead of returning a list, it will return an iterator. I think it worth repeating that Python 3 is at

Re: Python 3000, zip, *args and iterators

2004-12-26 Thread Terry Reedy
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So, as I understand it, in Python 3000, zip will basically be replaced > with izip, meaning that instead of returning a list, it will return an > iterator. I think it worth repeating that Python 3 is at yet somethin

Python 3000, zip, *args and iterators

2004-12-26 Thread Steven Bethard
So, as I understand it, in Python 3000, zip will basically be replaced with izip, meaning that instead of returning a list, it will return an iterator. This is great for situations like: zip(*[iter1, iter2, iter3]) where I want to receive tuples of (item1, item2, item3) from the iterables.