Questions about list-creation
- From: Manuel Graune <manuel.graune@xxxxxxxx>
- Date: Mon, 30 Nov 2009 18:22:17 +0100
in (most) python documentation the syntax "list()"
and "" is treated as being more or less the same
thing. For example "help()" and "help(list())" point
to the same documentation. Since there are at least
two cases where this similarity is not the case, (see below)
can someone explain the reasoning behind this and point to
further / relevant documentation?
(To clarify: I am not complaining about this, just asking.)
when using local variables in list comprehensions, say
a=[i for i in xrange(10)]
the local variable is not destroyed afterwards:
using the similar code
b=list(j for j in xrange(10))
the local variable is destroyed after use:
A hundred men did the rational thing. The sum of those rational choices was
called panic. Neal Stephenson -- System of the world
Key fingerprint = 1E44 9CBD DEE4 9E07 5E0A 5828 5476 7E92 2DB4 3C99
- Prev by Date: Re: problem with lambda / closures
- Next by Date: Re: how to format a python source file with tools?
- Previous by thread: Re: Completely OT
- Next by thread: Re: Questions about list-creation