Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Hanni Ali
Correct, however other areas of the application expect an empty list to be present, otherwise I would have used None. 2009/1/26 Matthieu Brucher > 2009/1/26 Hanni Ali : > > Yes fair point, but when it's a empty list and new elements are replaced > > with a new list instance it's fine, especially

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Matthieu Brucher
2009/1/26 Hanni Ali : > Yes fair point, but when it's a empty list and new elements are replaced > with a new list instance it's fine, especially as [[]]*10 is > significantly faster than [[] for i in xrange(10)] as I was previously > doing. In this case, why do you put a list in it in the

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Hanni Ali
Yes fair point, but when it's a empty list and new elements are replaced with a new list instance it's fine, especially as [[]]*10 is significantly faster than [[] for i in xrange(10)] as I was previously doing. In fact I think that's partly answered my question [[]]*x must create a list o

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Matthieu Brucher
Hi, Don't remember that you are using the same list in each element of the outer list. If you don't want this, use [[] for i in range(5)]. I don't think there is another way in C either (or too complicated). Matthieu 2009/1/26 Hanni Ali : > Hi, > > Quick question, I've been doing a fair bit of e