On Thu, Mar 7, 2013 at 3:19 PM, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
> Nikita Nemkin wrote:
>>
>> Sorry, accidental early send. Previous mail continued...
>>
>> [None] * N makes an extra pass over the list to assign None to each item
>> (and also incref None n times).
>
>
> Maybe this could be optimised by adding N to the reference
> count instead of incrementing it N times?

I'd be surprised if the C compiler doesn't.

http://hg.python.org/cpython/file/1d4849f9e37d/Objects/listobject.c#l515
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to