micropython/tests/basics/subclass_classmethod.py

13 lines
150 B
Python

# Calling an inherited classmethod
class Base:
@classmethod
def foo(cls):
print(cls.__name__)
class Sub(Base):
pass
Sub.foo()