should I put old or new style classes in my book?

Matthieu Brucher matthieu.brucher at gmail.com
Fri May 30 04:33:23 EDT 2008


2008/5/29 Alan Isaac <aisaac at american.edu>:

> This thread raises two questions for me.
>
>
>
> 1. I take it from this thread that in Python 3 the
>
> following are equivalent:
>
>
>
>       class Test: pass
>
>
>
>       class Test(object): pass
>
>
>
> Is that correct, and if so, where is it stated explicitly?
>
> (I know about the "all classes are new style classes" statement.)
>

All classes are new style classes, and the usual

class MyClass(object) pass

should be replaced by the first

class MyClass: pass

IIRC. I don't know ATM where I read it.

Matthieu
-- 
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080530/a103aacb/attachment-0001.html>


More information about the Python-list mailing list