diff options
author | Jess Shapiro <jesse@jesseshapiro.net> | 2018-12-24 07:47:38 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2018-12-24 07:47:38 (GMT) |
commit | e7eed78f04085e6cded0cebcc715364b05e8a71b (patch) | |
tree | 5111f03b4694e21489a837677376b5ed97d546c0 /Objects | |
parent | d83f5bda34cb25503570a9c28f6d5b4bb74d3624 (diff) | |
download | cpython-e7eed78f04085e6cded0cebcc715364b05e8a71b.zip cpython-e7eed78f04085e6cded0cebcc715364b05e8a71b.tar.gz cpython-e7eed78f04085e6cded0cebcc715364b05e8a71b.tar.bz2 |
Clarify the behavior of the staticmethod builtin (GH-4362)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/funcobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 2add874..4fab358 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -838,7 +838,8 @@ PyClassMethod_New(PyObject *callable) ... 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. + (e.g. C().f()). Both the class and the instance are ignored, and + neither is passed implicitly as the first argument to the method. Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see class methods above. @@ -945,7 +946,8 @@ To declare a static method, use this idiom:\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\ +(e.g. C().f()). Both the class and the instance are ignored, and\n\ +neither is passed implicitly as the first argument to the method.\n\ \n\ Static methods in Python are similar to those found in Java or C++.\n\ For a more advanced concept, see the classmethod builtin."); |