class A():
def p1(self, x): print("A p1", x)
@virtual
def p2(self, x): pass
class B(A):
def p3(self, x): print("B p2", x)
= B()
b 1)
b.p1(try:
1)
b.p2(except BaseException as e:
print("Exception that would be raised: ", e)
A p1 1
Exception that would be raised: Virtual method p2 needs to be implemented by subclass B.