method overriding

Defining a method in a subclass with the same name as one in its parent, so the subclass's version is used instead.

In more detail

The overriding method can still call the parent's version through super(), for example to add a step before or after it. Python finds the overriding method first because it searches the subclass before its parents.

Related terms

Taught in

References

Certification courses