19 lines
367 B
Plaintext
19 lines
367 B
Plaintext
class Foo():
|
|
def amethod():
|
|
print("If this were Python, I'd be impossible to call.")
|
|
@staticmethod
|
|
def astatic():
|
|
print("these are special now")
|
|
|
|
# This doesn't work because amethod is unbound and needs an instance.
|
|
try:
|
|
Foo.amethod()
|
|
except:
|
|
print(exception.arg)
|
|
# This works
|
|
Foo.amethod(Foo())
|
|
# This should too?
|
|
Foo.astatic()
|
|
|
|
|