Python class inherits object -
is there reason class declaration inherit object
?
i found code , can't find reason why.
class myclass(object): # class code follows...
yes, 'new style' object. feature introduced in python2.2.
new style objects have different object model classic objects, , things won't work old style objects, instance, super(), @property , descriptors. see article description of new style class is:
http://docs.python.org/release/2.2.3/whatsnew/sect-rellinks.html
so link description of differences: what difference between old style , new style classes in python?
Comments
Post a Comment