class Foo:
def __init__(self, must_be_a_number):
if type(must_be_a_number) is not int:
raise ValueError("Foo must be constructed with an integer!")
self.value = must_be_a_number
class Foo(Foo):
def __init__(self, can_be_a_str):
super(Foo, self).__init__(int(can_be_a_str))
a = Foo(6)
b = Foo("7")
print(a.value)
print(b.value)