Antoon Pardon a écrit : > On 2005-11-30, Duncan Booth <[EMAIL PROTECTED]> 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 ? -- http://mail.python.org/mailman/listinfo/python-list