On Wed, Oct 29, 2008 at 12:44 PM, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Chris Rebert a écrit :
> (snip)
>
>> Note that the "accumulation" behavior of lists is considered an
>> aberration
>>
>
> By who ?
>
All the python newbies who don't read the tutorial and get tripped up by
this.
Chris Rebert a écrit :
(snip)
Note that the "accumulation" behavior of lists is considered an
aberration
By who ?
--
http://mail.python.org/mailman/listinfo/python-list
Paulo J. Matos a écrit :
Hi all,
Going through the tutorial brought up a question. Consider the functions:
def f(a, L=[]):
L.append(a)
return L
print f(3)
print f(9)
print f(7)
def f1(i = 0):
i = i + 1
print i
f1()
f1()
f1()
f1()
Since the f accumulates the values in L, I wa
On Wed, Oct 29, 2008 at 9:14 AM, Paulo J. Matos <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Going through the tutorial brought up a question. Consider the functions:
>
> def f(a, L=[]):
>L.append(a)
>return L
>
> print f(3)
> print f(9)
> print f(7)
>
> def f1(i = 0):
>i = i + 1
>print
Hi all,
Going through the tutorial brought up a question. Consider the functions:
def f(a, L=[]):
L.append(a)
return L
print f(3)
print f(9)
print f(7)
def f1(i = 0):
i = i + 1
print i
f1()
f1()
f1()
f1()
Since the f accumulates the values in L, I was expecting to see i
printi