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

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri Jun 15 18:17:55 EDT 2007


In <1181935045.323196.287810 at n2g2000hse.googlegroups.com>, 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 something that unreadable and magic instead
of the perfect readable ``for k, v in some_dict.iteritems():``?

And I don't see why it should be ``**``!?

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list