diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-05-19 16:34:13 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-05-19 16:34:13 (GMT) |
commit | 7fc570a51e6d8647d73e152721b2e72add72d134 (patch) | |
tree | e735131f83155d73d136ef2d3d8e3c7ed1d653b3 /Doc/library/functions.rst | |
parent | 7c5ba513b924692e534e372a135add15e70ac0cb (diff) | |
download | cpython-7fc570a51e6d8647d73e152721b2e72add72d134.zip cpython-7fc570a51e6d8647d73e152721b2e72add72d134.tar.gz cpython-7fc570a51e6d8647d73e152721b2e72add72d134.tar.bz2 |
Close #14588: added a PEP 3115 compliant dynamic type creation mechanism
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 9287bfb..35f05d4 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1324,10 +1324,12 @@ are always available. They are listed here in alphabetical order. Accordingly, :func:`super` is undefined for implicit lookups using statements or operators such as ``super()[name]``. - Also note that :func:`super` is not limited to use inside methods. The two - argument form specifies the arguments exactly and makes the appropriate - references. The zero argument form automatically searches the stack frame - for the class (``__class__``) and the first argument. + Also note that, aside from the zero argument form, :func:`super` is not + limited to use inside methods. The two argument form specifies the + arguments exactly and makes the appropriate references. The zero + argument form only works inside a class definition, as the compiler fills + in the necessary details to correctly retrieve the class being defined, + as well as accessing the current instance for ordinary methods. For practical suggestions on how to design cooperative classes using :func:`super`, see `guide to using super() |