11 lines
170 B
Python
11 lines
170 B
Python
|
class Foo:
|
||
|
@classmethod
|
||
|
def doThing(cls):
|
||
|
print("Called from a",cls)
|
||
|
class Bar(Foo):
|
||
|
pass
|
||
|
Foo.doThing()
|
||
|
Foo().doThing()
|
||
|
Bar.doThing()
|
||
|
Bar().doThing()
|