Skip to content

Instantly share code, notes, and snippets.

@sonkm3
Created September 8, 2011 05:40
Show Gist options
  • Save sonkm3/1202710 to your computer and use it in GitHub Desktop.
Save sonkm3/1202710 to your computer and use it in GitHub Desktop.
python classmethod/staticmethod
# -*- coding: utf-8 -*-
class Foo(object):
def method_1(self):
print self
@classmethod
def classmethod_1(cls):
print cls
@staticmethod
def staticmethod_1():
print Foo
foo = Foo()
foo.method_1()
foo.classmethod_1()
foo.staticmethod_1()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment