Message183365
> There's an obvious need for this, CPython uses optimizations like this
> internally, as does PyPy.
I don't know if it's a need or if it's just "nice to have".
By the way, in the list case it also makes C code simpler, since once
the list is preallocated you just have to call PyList_SET_ITEM to
populate it, and there's no error return to worry about.
Also, lists are easy to pre-allocate in pure Python as well:
l = [None] * N
# populate
for i in range(N):
l[i] = ... |
|
Date |
User |
Action |
Args |
2013-03-03 10:29:59 | pitrou | set | recipients:
+ pitrou, rhettinger, benjamin.peterson, alex |
2013-03-03 10:29:59 | pitrou | link | issue17338 messages |
2013-03-03 10:29:59 | pitrou | create | |
|