Message140754
Hi,
no it's not a bug :)
What you actually get with [[0]]*3 is a list of 3 references to the same list, [0]:
>>> a = [[0], [0], [0]]
>>> b = [[0]]*3
>>> for i in a: print(id(i))
...
139807725184032
139807725300280
139807725300520
>>> for i in b: print(id(i))
...
139807725324016
139807725324016
139807725324016 |
|
Date |
User |
Action |
Args |
2011-07-20 17:07:10 | sandro.tosi | set | recipients:
+ sandro.tosi, xintx-ua |
2011-07-20 17:07:10 | sandro.tosi | set | messageid: <1311181630.55.0.746547682604.issue12597@psf.upfronthosting.co.za> |
2011-07-20 17:07:09 | sandro.tosi | link | issue12597 messages |
2011-07-20 17:07:09 | sandro.tosi | create | |
|