I am confused on what the folowing means:
class class_name(object):
What does the class takes in between the parenthesis? is it inheritance?
I am confused on what the folowing means:
class class_name(object):
What does the class takes in between the parenthesis? is it inheritance?
It's the superclass. There can be more than one, though getting that right and making it useful can be a bit tricky. There can also be none, but unless you're on Python 3, that's a bad idea.
Basically it is inheritance. You might find this thread and some of the related links useful: Python class inherits object.
Yes. It's inheritance. This is what it looks like:
class DerivedClass(BaseClass)
In your declaration, you're basically inheriting the object
type. It's a built-in. However, in Python 3 you don't need to do this, as every class is implicitly a subclass of object
.
By the way, more about this here.
class class_name(object):
This is called inheritance
Python also supports multiple inheritance , that means you can inherit from multiple classes
for example:
class class_name(BaseClassName1,BaseClassName2,BaseClassName3):