diff options
author | Éric Araujo <merwok@users.noreply.github.com> | 2017-10-12 16:28:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-12 16:28:55 (GMT) |
commit | 03b9537dc515d10528f83c920d38910b95755aff (patch) | |
tree | 78544b30548bd7d2b5a4b703387962ba819bf049 /Doc/library/functions.rst | |
parent | cba9a0c6def70549046f1afa6a80e38fe706520e (diff) | |
download | cpython-03b9537dc515d10528f83c920d38910b95755aff.zip cpython-03b9537dc515d10528f83c920d38910b95755aff.tar.gz cpython-03b9537dc515d10528f83c920d38910b95755aff.tar.bz2 |
bpo-31567: more decorator markup fixes in docs (GH-3959) (#3966)
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index eed6730..e472257 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1419,12 +1419,21 @@ are always available. They are listed here in alphabetical order. :func:`classmethod` for a variant that is useful for creating alternate class constructors. + Like all decorators, it is also possible to call ``staticmethod`` as + a regular function and do something with its result. This is needed + in some cases where you need a reference to a function from a class + body and you want to avoid the automatic transformation to instance + method. For these cases, use this idiom: + + class C: + builtin_open = staticmethod(open) + For more information on static methods, consult the documentation on the standard type hierarchy in :ref:`types`. - .. index:: - single: string; str() (built-in function) +.. index:: + single: string; str() (built-in function) .. _func-str: .. class:: str(object='') |