[Tutor] new book available

Alan Gauld alan.gauld at blueyonder.co.uk
Tue Sep 9 09:14:38 EDT 2003


> author's distinguishing "new" style class definitions
> from "old" style ones. 
> 
> >>>class Test:
> 
> >>>class Test (object):
> 
> is the newer style. I don't think I've seen this point
> discussed on PythonTutor or elsewhere. [Have I missed
> something?]

Yes, there's been a couple of discussions about new style 
classes. The fact that they inherit from 'object' (or
a subclas of object) is indeed the distinguishing feature.

ie  

>>> class Number(int):

is also a new style class because int is a subclass of object...

Alan G.





More information about the Tutor mailing list