Message166081
Hi,
I thought that I can easily create a list of, say 3, nested lists:
$ python
Python 2.7.3 (default, May 17 2012, 21:10:41)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 3 * [[]]
[[], [], []]
>>> a=3 * [[]]
>>> a[0]
[]
>>> a[1].append('sdds')
>>> a
[['sdds'], ['sdds'], ['sdds']]
>>> a[0].append('xxx')
>>> a
[['sdds', 'xxx'], ['sdds', 'xxx'], ['sdds', 'xxx']]
The below works as expected.
>>> a=[[], [], []]
>>> a
[[], [], []]
>>> a[0]
[]
>>> a[1]
[]
>>> a[1].append('sdds')
>>> a[0].append('xxx')
>>> a
[['xxx'], ['sdds'], []]
>>>
Of course, I want to do like:
a = len(b) * [] # to get a list of individual hashes
c = len(b) * [0] # to get a list of indvidual counters |
|
Date |
User |
Action |
Args |
2012-07-21 21:54:35 | mmokrejs | set | recipients:
+ mmokrejs |
2012-07-21 21:54:35 | mmokrejs | set | messageid: <1342907675.08.0.583810202929.issue15416@psf.upfronthosting.co.za> |
2012-07-21 21:54:34 | mmokrejs | link | issue15416 messages |
2012-07-21 21:54:34 | mmokrejs | create | |
|