Reputation: 2031
What is difference between these two type of class declarations?
class ClassName():
class ClassName(object):
What does this object
parameter does?
Upvotes: 0
Views: 65
Reputation:
In Python 2 from 2.1, there are two kinds of classes, new-style and classic. Deriving from object
in Python 2, from 2.1 on, will create a new-style class. In Python 3, there's only one kind, and so both forms are the same.
Upvotes: 1