Source code
The files are in a package, named person.male.py
class Male():
sex_chromosomes = "XY"
def __init__(self):
self.type = "male"
def say(self):
#super().say()
print("I am a male")
man.py
from person import male
male = Male()
male.say()
Problem
Male() is a class in module male, you can call the class in module by dotman.pyA related error using this example :
from person import male
male = male.Male()
male.say()
[Python3][Resolved] TypeError: 'module' object is not callable, module & inheritance
No comments :
Post a Comment