@@ -697,8 +697,9 @@ PyTypeObject PyFunction_Type = {
697697 To declare a class method, use this idiom:
698698
699699 class C:
700- def f(cls, arg1, arg2, ...): ...
701- f = classmethod(f)
700+ @classmethod
701+ def f(cls, arg1, arg2, ...):
702+ ...
702703
703704 It can be called either on the class (e.g. C.f()) or on an instance
704705 (e.g. C().f()); the instance is ignored except for its class.
@@ -808,8 +809,9 @@ just like an instance method receives the instance.\n\
808809To declare a class method, use this idiom:\n\
809810\n\
810811 class C:\n\
811- def f(cls, arg1, arg2, ...): ...\n\
812- f = classmethod(f)\n\
812+ @classmethod\n\
813+ def f(cls, arg1, arg2, ...):\n\
814+ ...\n\
813815\n\
814816It can be called either on the class (e.g. C.f()) or on an instance\n\
815817(e.g. C().f()). The instance is ignored except for its class.\n\
@@ -880,8 +882,9 @@ PyClassMethod_New(PyObject *callable)
880882 To declare a static method, use this idiom:
881883
882884 class C:
883- def f(arg1, arg2, ...): ...
884- f = staticmethod(f)
885+ @staticmethod
886+ def f(arg1, arg2, ...):
887+ ...
885888
886889 It can be called either on the class (e.g. C.f()) or on an instance
887890 (e.g. C().f()); the instance is ignored except for its class.
@@ -986,8 +989,9 @@ A static method does not receive an implicit first argument.\n\
986989To declare a static method, use this idiom:\n\
987990\n\
988991 class C:\n\
989- def f(arg1, arg2, ...): ...\n\
990- f = staticmethod(f)\n\
992+ @staticmethod\n\
993+ def f(arg1, arg2, ...):\n\
994+ ...\n\
991995\n\
992996It can be called either on the class (e.g. C.f()) or on an instance\n\
993997(e.g. C().f()). The instance is ignored except for its class.\n\
0 commit comments