Re: Should: "for k,v in **dictionary_instance" work?

2007-06-16 Thread Eduardo \"EdCrypt\" O. Padoan
> 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

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-16 Thread irstas
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

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread Steven D'Aprano
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

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread Dustan
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

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread Marc 'BlackJack' Rintsch
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

Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread keithgabryelski
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