[Numpy-discussion] List of Lists in C

Hanni Ali hanni.ali at gmail.com
Mon Jan 26 03:08:35 EST 2009


Hi,

Quick question, I've been doing a fair bit of extension writing in C
recently, but wondered how best to implement:

>>> l = [[]] * 5

to create a list of a given length containing the initialization variable
desired.

A loop seems the straight forward manner, but I would have thought there was
a more efficient way...


Currently I just do it in Python and pass through the already initialized
list as it seems perfectly efficient.

Cheers,

Hanni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090126/f98b5edd/attachment.html>


More information about the NumPy-Discussion mailing list