Use the super()
function:
class Foo(Bar):
def baz(self, **kwargs):
return super().baz(**kwargs)
For Python < 3, you must explicitly opt in to using new-style classes and use:
class Foo(Bar):
def baz(self, arg):
return super(Foo, self).baz(arg)
More Related Contents:
- Understanding Python super() with __init__() methods [duplicate]
- What is the difference between __init__ and __call__?
- List all base classes in a hierarchy of given class?
- What is the difference between old style and new style classes in Python?
- What are the differences between type() and isinstance()?
- Spawning multiple instances of the same object concurrently in python
- difference between variables inside and outside of __init__()
- super() fails with error: TypeError “argument 1 must be type, not classobj” when parent does not inherit from object
- How can I dynamically create derived classes from a base class
- What is the `self` parameter in class methods?
- Attaching a decorator to all functions within a class
- Why do attribute references act like this with Python inheritance? [duplicate]
- How do I access Class member variables in Python?
- Which classes cannot be subclassed?
- Why is `object` an instance of `type` and `type` an instance of `object`?
- The scope of names defined in class block doesn’t extend to the methods’ blocks. Why is that?
- How to implement a binary search tree in Python?
- Getting container/parent object from within python
- Python: how to “kill” a class instance/object?
- How can I create an object and add attributes to it?
- How do I access Class member variables?
- How do I set and access attributes of a class? [duplicate]
- Python object attributes – methodology for access
- How do you change the value of one attribute by changing the value of another? (dependent attributes)
- Correctly extend a tkinter widget using inheritance
- Should I use a class or dictionary?
- Python: deleting a class attribute in a subclass
- In Python, when are two objects the same?
- Type Hinting for objects of type that’s being defined [duplicate]
- Accessing attribute from parent class inside child class