[Python-Dev] re: Sets BOF / for in dict

Thomas Wouters thomas@xs4all.net
Sun, 4 Feb 2001 16:10:28 +0100


On Sun, Feb 04, 2001 at 09:19:47AM -0500, Greg Wilson wrote:

> If the keys to the dictionary are (for example) 2-element tuples, then:
>     for (left, right):value in dict:
> would also be expected to work, 

There is no real technical reason for it not to work. From a grammer point
of view, 

  for left, right:value in dict:

would also work fine. (the grammar would be:

  'for' exprlist [':' exprlist] 'in' testlist:

and since there can't be a colon inside an exprlist, it's not ambiguous.)
The main problem is whether you *want* that to work :)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!