@@ -674,8 +674,9 @@ PyTypeObject PyFunction_Type = {
674674 To declare a class method, use this idiom:
675675
676676 class C:
677- def f(cls, arg1, arg2, ...): ...
678- f = classmethod(f)
677+ @classmethod
678+ def f(cls, arg1, arg2, ...):
679+ ...
679680
680681 It can be called either on the class (e.g. C.f()) or on an instance
681682 (e.g. C().f()); the instance is ignored except for its class.
@@ -785,8 +786,9 @@ just like an instance method receives the instance.\n\
785786To declare a class method, use this idiom:\n\
786787\n\
787788 class C:\n\
788- def f(cls, arg1, arg2, ...): ...\n\
789- f = classmethod(f)\n\
789+ @classmethod\n\
790+ def f(cls, arg1, arg2, ...):\n\
791+ ...\n\
790792\n\
791793It can be called either on the class (e.g. C.f()) or on an instance\n\
792794(e.g. C().f()). The instance is ignored except for its class.\n\
@@ -857,8 +859,9 @@ PyClassMethod_New(PyObject *callable)
857859 To declare a static method, use this idiom:
858860
859861 class C:
860- def f(arg1, arg2, ...): ...
861- f = staticmethod(f)
862+ @staticmethod
863+ def f(arg1, arg2, ...):
864+ ...
862865
863866 It can be called either on the class (e.g. C.f()) or on an instance
864867 (e.g. C().f()); the instance is ignored except for its class.
@@ -963,8 +966,9 @@ A static method does not receive an implicit first argument.\n\
963966To declare a static method, use this idiom:\n\
964967\n\
965968 class C:\n\
966- def f(arg1, arg2, ...): ...\n\
967- f = staticmethod(f)\n\
969+ @staticmethod\n\
970+ def f(arg1, arg2, ...):\n\
971+ ...\n\
968972\n\
969973It can be called either on the class (e.g. C.f()) or on an instance\n\
970974(e.g. C().f()). The instance is ignored except for its class.\n\
0 commit comments