Quickies

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

Python
  1. class C:
    
        def foo(x, y):
            print "staticmethod", x, y
        foo = staticmethod(foo)
    
    C.foo(1, 2)
    c = C()
    c.foo(1, 2)
    

    Unifying types and classes in Python 2.2