Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ClassName.StaticMethod ( )
- class MyClass(object):
- @staticmethod
- def the_static_method(x):
- print x
- MyClass.the_static_method(2) # outputs 2
- class C:
- @staticmethod
- def f(arg1, arg2, ...): ...
- >>> class C:
- ... @staticmethod
- ... def hello():
- ... print "Hello World"
- ...
- >>> C.hello()
- Hello World
Add Comment
Please, Sign In to add comment