Newbie questions

Ladvánszky Károly aa at bb.cc
Mon Mar 24 13:13:51 EST 2003


Thanks but your version runs the same time as mine does.

<sismex01 at hebmex.com> az alábbiakat írta a következo hírüzenetben:
mailman.1048526801.11395.python-list at python.org...
> >
> > 1.
> > Is there a faster way to allocate a list of objects than this one?
> >
> > ls=cnt*[None]
> > for j in range(cnt):
> >     ls[j]=TestClass(j)
> >
>
> ls = [ TestClass(j) for j in range(cnt) ]
>
>
> -gustavo
>






More information about the Python-list mailing list