I really don't understand why so complicated. It looks like you are really confused about inheritance and instantiation.
At the moment basically you cannot use your BaseClass. You can use only the Person1 class. From what you show you must combine BaseClass and Person1 class into single BaseClass and user can subclass that BaseClass
At the moment basically you cannot use your BaseClass. You can use only the Person1 class. From what you show you must combine BaseClass and Person1 class into single BaseClass and user can subclass that BaseClass
class BaseClass: # in python3 all classes are "new style" classes and inherit from object def __init__(self, name): self.name = name def print_name(self): print(self.name) class CustomClass(BaseClass): def print_name(self): print("Hello my name is %s" % self.name) foo = CustomClass('Bob') foo.print_name() bar = BaseClass('Joe') bar.print_name()Note, there is no need to generate new classes for every name from dataset (because it sounds that's what you are doing). That's what the instances are.
BaseClass
may reside in different module from the one in which CustomClass
is defined, user just need to import BaseClass
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs