object-oriented programming parabola( - ( print( print( table( )the real meaning of inheritance from practical viewpointand for the examples in this bookthe point of inheritance is to reuse methods and attributes from the base class and minimize code duplication on more theoretical levelinheritance should be thought of as an "is-arelationship between the the two classes by this we mean that if parabola is subclass of linean instance of parabola is also line instance the parabola class is thought of as special case of the line classand therefore every parabola is also linebut not vice versa we can check class type and class relations with the built-in functions isinstance(objtypeand issubclass(subclassnamesuperclassname)from line_parabola import lineparabola line(- isinstance(llinetrue isinstance(lparabolafalse parabola(- isinstance(pparabolatrue isinstance(plinetrue issubclass(parabolalinetrue issubclass(lineparabolafalse __class__ =parabola true __class__ __name__ string version of the class name 'parabolawe will not use these methods much in practical applications but they are very useful for gaining feel for class relationships when learning oop mathematically oriented readers might have noticed logical fault in the small class hierarchy we have presented so far we stated that subclass is usually thought of as special case of the base classbut parabola is not really special case of straight line it is the other way aroundsince line is parabola with could then linethenbe subclass of parabolacertainlyand many will prefer this relation between line and parabolasince it follows the usual is- relationship between subclass and its base the code can look like if you have to use isinstance in your code to check what kind of object you are working withit is usually sign that the program is poorly designed there are exceptionsbut normally isinstance and issubclass should only be used for learning and debugging