Why new Python 2.5 feature "class C()" return old-style class ?

Felipe Almeida Lessa felipe.lessa at gmail.com
Tue Apr 11 10:16:02 EDT 2006


Em Ter, 2006-04-11 às 06:49 -0700, looping escreveu:
> But in an other hand,
> I believe that new-style class are faster to instanciate (maybe I'm
> wrong...).

$ python2.4 -m timeit -s 'class x: pass' 'x()'
1000000 loops, best of 3: 0.435 usec per loop
$ python2.4 -m timeit -s 'class x(object): pass' 'x()'
1000000 loops, best of 3: 0.316 usec per loop

-- 
Felipe.




More information about the Python-list mailing list