Re: Questions about list-creation

2009-12-01 Thread Manuel Graune
Thanks to all of you. You have been most helpful. Regards, Manuel Graune -- A hundred men did the rational thing. The sum of those rational choices was called panic. Neal Stephenson -- System of the world http://www.graune.org/GnuPG_pubkey.asc Key fingerprint = 1E44 9CBD DEE4 9E07 5E0A 5828 5

Re: Questions about list-creation

2009-11-30 Thread Terry Reedy
Manuel Graune wrote: in (most) python documentation the syntax "list()" and "[]" is treated as being more or less the same thing. Untrue. List() and [] happen to both evaluate to the same thing, an empty list. But there is no reason to expect list() and [] to always evaluate to the same thing

Re: Questions about list-creation

2009-11-30 Thread Luis Zarrabeitia
On Monday 30 November 2009 12:22:17 pm Manuel Graune wrote: > > when using local variables in list comprehensions, say > > a=[i for i in xrange(10)] > > the local variable is not destroyed afterwards: [...] > b=list(j for j in xrange(10)) > > the local variable is destroyed after use: Actually, []

Re: Questions about list-creation

2009-11-30 Thread Stephen Hansen
On Mon, Nov 30, 2009 at 9:22 AM, Manuel Graune wrote: > 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 simi

Re: Questions about list-creation

2009-11-30 Thread inhahe
i should also mention that a=[i for i in xrange(10)] and b=list(j for j in xrange(10)) isn't really just a difference of using [] vs. list() the first case is a list comprehension, the second case is a generator comprehension which is then converted to a list (the bug only applies to list compr

Re: Questions about list-creation

2009-11-30 Thread Mel
Manuel Graune wrote: > 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 belo

Re: Questions about list-creation

2009-11-30 Thread Lie Ryan
On 12/1/2009 4:22 AM, Manuel Graune wrote: Hello, 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 n

Re: Questions about list-creation

2009-11-30 Thread inhahe
On Mon, Nov 30, 2009 at 12:22 PM, Manuel Graune wrote: > > Hello, > > 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 w

Questions about list-creation

2009-11-30 Thread Manuel Graune
Hello, 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