Cyclic inheritance occurs when two or more classes inherit from each other in a circular fashion, which is not supported in Python as it would result in undefined class names. For example, if a class A tries to inherit from itself as class A(A):pass, it would result in a NameError since A is not yet defined when it is being inherited.
Download as PPT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
298 views
Python Cyclic Inheritance
Cyclic inheritance occurs when two or more classes inherit from each other in a circular fashion, which is not supported in Python as it would result in undefined class names. For example, if a class A tries to inherit from itself as class A(A):pass, it would result in a NameError since A is not yet defined when it is being inherited.
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 2
6) Cyclic Inheritance:
The concept of inheriting properties from one
class to another class in cyclic way, is called Cyclic inheritance.Python won't support for Cyclic Inheritance of course it is really not required. Eg - 1: class A(A):pass NameError: name 'A' is not defined