Quickies

[categories] [index] [all (531)] [latest]

Python
  1. class C:
    
        def foo(cls, y):
            print "classmethod", cls, y
        foo = classmethod(foo)
    
    C.foo(1)
    c = C()
    c.foo(1)
    

    Unifying types and classes in Python 2.2