Message207410
I was using IDLE (Python GUI) for Python 3.3.3. I don't know if this is a bug or you guys intend it to be this way:
>>> x=[1,2]
>>> y=x
>>> y.append(3)
>>> x
[1, 2, 3]
personally i'd prefer x stays as [1,2] when i'm trying to mutate y
also:
>>> def f1(m,n=['haha']):
if m==n:
print('m==n')
else:
print('m!=n')
n.append('yaya')
>>> f1(['haha'])
m==n
>>> f1(['haha'])
m!=n
I'd prefer getting consistent results when calling functions like f1 |
|
Date |
User |
Action |
Args |
2014-01-06 03:37:24 | m123orning | set | recipients:
+ m123orning |
2014-01-06 03:37:24 | m123orning | set | messageid: <1388979444.45.0.0357103143169.issue20135@psf.upfronthosting.co.za> |
2014-01-06 03:37:24 | m123orning | link | issue20135 messages |
2014-01-06 03:37:24 | m123orning | create | |
|