On 2010-10-08, Grant Edwards <inva...@invalid.invalid> wrote:
> On 2010-10-08, Grant Edwards <inva...@invalid.invalid> wrote:
>> On 2010-10-07, Rog??rio Brito <rbr...@ime.usp.br> wrote:
>>
>>> If possible, I would like to simply declare the list and fill it
>>> latter in my program, as lazily as possible (this happens notoriously
>>> when one is using a technique of programming called dynamic
>>> programming where initializing all positions of a table may take too
>>> much time in comparison to the filling of the array).
>>
>> At first you say you want a list, later you say you want an array.
>> They're two different things.  Arrays are variable-length and can be
>> heterogeneous.
>
> I meant _Lists_ are fixed-length and homogeneous

Damn.  I should give up and go golfing.

_Lists_ are variable-length and can be heterogenous.

_Arrays_ are homogenous and sort-of fixed length.

> [...] I was thinking more of NumPy arrays, where you can create an
> arbitrary sized homogeneous array of a desired type (either
> uninitialized or filled with zeros or ones):
>
>   
> http://www.scipy.org/Tentative_NumPy_Tutorial#head-d3f8e5fe9b903f3c3b2a5c0dfceb60d71602cf93
>
> If you're crunching so many numbers that initializing a list is
> a problem, then you probably ought to be using NumPy.

-- 
Grant Edwards               grant.b.edwards        Yow! I'm shaving!!
                                  at               I'M SHAVING!!
                              gmail.com            
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to