MCPcopy Create free account
hub / github.com/ActiveState/code / classmethod

Function classmethod

recipes/Python/113645_Classmethod/recipe-113645.py:3–5  ·  view source on GitHub ↗

Impulate py2.2 classmethod function. -> class method

(method)

Source from the content-addressed store, hash-verified

1# junk.py
2
3def classmethod(method):
4 '''Impulate py2.2 classmethod function. -> class method'''
5 return lambda self, *args, **dict: method(self.__class__, *args, **dict)
6
7class Foo:
8 def bar(klass):

Callers 15

FooClass · 0.70
POINTERFunction · 0.50
MyClassClass · 0.50
blessMethod · 0.50
IntegerBagClass · 0.50
CombinativeClass · 0.50
AnimalsClass · 0.50
case_decoratorFunction · 0.50
PointClass · 0.50
DoDefaultMixinClass · 0.50
hook_adviceFunction · 0.50

Calls 1

methodFunction · 0.85

Tested by

no test coverage detected