Open DominicParent opened 3 years ago
Use assertions for type enforcement.
assert isinstance(a, int), 'Expected int'
See https://www.youtube.com/watch?v=5nXmq1PsoJ0 @ 18:02.
class Contract: @classmethod def check(cls, value): pass class Integer(Contract): @classmethod def check(cls, value): assert isinstance(value, int), 'Expected int'
Use assertions for type enforcement.
assert isinstance(a, int), 'Expected int'
See https://www.youtube.com/watch?v=5nXmq1PsoJ0 @ 18:02.