Class and object at the same time in Python?
Hi! Supposing the following example: we have the object Spike which belongs to the class Doberman which inherits class Pet which inherits class Dog which inherits class Four_Legs_Animal which inherits NotFoodAnimal which inherits class Animal which inherits class Life. Life--->Animal--->NotFoodAnimal--->Four_Legs_Animal--->Dog--->Pet--->Doberman--->Spike. Supposing your python program doesn't have defined each class and it is reading some text from a file. From that text Animal can be a final object like Spike is and if it doesn't read further it thinks that Animal is the final object so the class Animal can be an object at anytime. But it reads more text and it finds out that there are more kinds of animals with two and four legs and some of them can be food and others don't. So it creates by itself these classes accordingly. But it reads further and its conclusion that the final class could be Dog. So creates the Dog class as an object. Further it finds out that Spike is the final object. How to do this?