> Actually since you asked, I had to try this out
>
> x = range(10)
> a, *b = x
PEP 3132: Extended Iterable Unpacking
http://www.python.org/dev/peps/pep-3132/
--
EduardoOPadoan (eopadoan->altavix::com)
Bookmarks: http://del.icio.us/edcrypt
--
http://mail.python.org/mailman/listinfo/python-lis
On Jun 16, 5:27 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Currently, *t and **d are syntax errors outside of function calls and
> definitions. (Any other places?) But if they were allowed, what would they
> mean?
Actually since you asked, I had to try this out
x = range(10)
a, *b = x
I wo
On Fri, 15 Jun 2007 19:17:25 +, keithgabryelski wrote:
> Does it make sense to provide this syntax for iterating key/value
> pairs from a dictionary?
>
> for k,v in **dict():
>print k,v
>
> why is this not the same as:
>
> for k,v in dict().items():
> print k,v
Because *t and **d alre
On Jun 15, 2:17 pm, [EMAIL PROTECTED] wrote:
> Does it make sense to provide this syntax for iterating key/value
> pairs from a dictionary?
>
> for k,v in **dict():
>print k,v
>
> why is this not the same as:
>
> for k,v in dict().items():
> print k,v
>
> for that matter, why the heck doesn't
In <[EMAIL PROTECTED]>, keithgabryelski
wrote:
> Does it make sense to provide this syntax for iterating key/value
> pairs from a dictionary?
>
> for k,v in **dict():
>print k,v
>
> why is this not the same as:
>
> for k,v in dict().items():
> print k,v
Why should it be? Why adding some
Does it make sense to provide this syntax for iterating key/value
pairs from a dictionary?
for k,v in **dict():
print k,v
why is this not the same as:
for k,v in dict().items():
print k,v
for that matter, why the heck doesn't a dictionary default to
returning a tuple
k,v pair from its iter