Re: Death to tuples!
- From: Christophe <chris.cavalaria@xxxxxxx>
- Date: Wed, 30 Nov 2005 16:06:38 +0100
Antoon Pardon a écrit :
On 2005-11-30, Duncan Booth <duncan.booth@xxxxxxxxxxxxxxx> wrote:
Antoon Pardon wrote:
But lets just consider. Your above code could simply be rewritten as follows.
res = list() for i in range(10): res.append(i*i)
I don't understand your point here? You want list() to create a new list and [] to return the same (initially empty) list throughout the run of the program?
No, but I think that each occurence returning the same (initially empty) list throughout the run of the program would be consistent with how default arguments are treated.
What about that : def f(a): res = [a] return res
How can you return the same list that way ? Do you propose to make such construct illegal ?
.
- Follow-Ups:
- Re: Death to tuples!
- From: Antoon Pardon
- Re: Death to tuples!
- References:
- Re: Death to tuples!
- From: Duncan Booth
- Re: Death to tuples!
- From: Antoon Pardon
- Re: Death to tuples!
- Prev by Date: Re: Python-list Digest, Vol 14, Issue 147
- Next by Date: Re: python speed
- Previous by thread: Re: Death to tuples!
- Next by thread: Re: Death to tuples!
- Index(es):
Relevant Pages
|