[Python-Dev] accumulator display syntax
Alex Martelli
aleaxit at yahoo.com
Mon Oct 20 03:44:30 EDT 2003
More information about the Python-Dev mailing list
Mon Oct 20 03:44:30 EDT 2003
- Previous message: [Python-Dev] accumulator display syntax
- Next message: [Python-Dev] accumulator display syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Monday 20 October 2003 02:08 am, Greg Ewing wrote: > "Phillip J. Eby" <pje at telecommunity.com>: > > If you look at it this way, then you can consider [x for x in S] to be > > shorthand syntax for list(x for x in S), as they would both produce the > > same result. However, IIRC, the current listcomp implementation actually > > binds 'x' in the current local namespace, whereas the generator version > > would not. > > Are we sure about that? We are indeed sure (sadly) that list comprehensions leak control variable names. We can hardly be sure of what iterator comprehensions would be defined to do, given they don't exist, but surely we can HOPE that in an ideal world where iterator comprehensions were part of Python they would not be similarly leaky:-). Alex
- Previous message: [Python-Dev] accumulator display syntax
- Next message: [Python-Dev] accumulator display syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list