diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-09-17 07:59:14 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-09-17 07:59:14 (GMT) |
commit | d508d00919dccbc9dd5d3c86508f2db7a7c753a7 (patch) | |
tree | 141cdfbf0908146bab12636e5b270e59ea06b3a5 /Objects/funcobject.c | |
parent | abf275af5804c5f76fbe10c5cb1dd3d2e4b04c5b (diff) | |
parent | 6d57fe1c23430d0d51de243a177670b76c37dab5 (diff) | |
download | cpython-d508d00919dccbc9dd5d3c86508f2db7a7c753a7.zip cpython-d508d00919dccbc9dd5d3c86508f2db7a7c753a7.tar.gz cpython-d508d00919dccbc9dd5d3c86508f2db7a7c753a7.tar.bz2 |
Issue #28139: Merge indentation fixes from 3.5 into 3.6
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r-- | Objects/funcobject.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 261c16d..69cd973 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -674,8 +674,9 @@ PyTypeObject PyFunction_Type = { To declare a class method, use this idiom: class C: - def f(cls, arg1, arg2, ...): ... - f = classmethod(f) + @classmethod + def f(cls, arg1, arg2, ...): + ... It can be called either on the class (e.g. C.f()) or on an instance (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\ To declare a class method, use this idiom:\n\ \n\ class C:\n\ - def f(cls, arg1, arg2, ...): ...\n\ - f = classmethod(f)\n\ + @classmethod\n\ + def f(cls, arg1, arg2, ...):\n\ + ...\n\ \n\ It can be called either on the class (e.g. C.f()) or on an instance\n\ (e.g. C().f()). The instance is ignored except for its class.\n\ @@ -857,8 +859,9 @@ PyClassMethod_New(PyObject *callable) To declare a static method, use this idiom: class C: - def f(arg1, arg2, ...): ... - f = staticmethod(f) + @staticmethod + def f(arg1, arg2, ...): + ... It can be called either on the class (e.g. C.f()) or on an instance (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\ To declare a static method, use this idiom:\n\ \n\ class C:\n\ - def f(arg1, arg2, ...): ...\n\ - f = staticmethod(f)\n\ + @staticmethod\n\ + def f(arg1, arg2, ...):\n\ + ...\n\ \n\ It can be called either on the class (e.g. C.f()) or on an instance\n\ (e.g. C().f()). The instance is ignored except for its class.\n\ |