class Classname(object), what sort of word is 'object' in Python?
I didn't understand the answers given in the link. What is object in class Classname(object):
in Python?
class Classname(object), what sort of word is 'object' in Python?
I didn't understand the answers given in the link. What is object in class Classname(object):
in Python?
object
is a (global) variable. By default it is bound to a built-in class which is the root of the type hierarchy.(This leads to the interesting property that you can take any built-in type, and use the
__bases__
property to reach the type called object).Everything built-in that isn't a keyword or operator is an identifier.
quoting the answere there what it is saying is, object
is a predefined variable in python self, like open is a predefined function in python.