Skip to content

Instantly share code, notes, and snippets.

@carljm
Created December 21, 2023 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carljm/098a8ed9ab387f244c1e15a16bc193db to your computer and use it in GitHub Desktop.
Save carljm/098a8ed9ab387f244c1e15a16bc193db to your computer and use it in GitHub Desktop.
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index b2dd32f925e..09396b87245 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1780,6 +1780,13 @@ are always available. They are listed here in alphabetical order.
the second argument is a type, ``issubclass(type2, type)`` must be true (this
is useful for classmethods).
+ When called directly within an ordinary method of a class, both arguments may
+ be omitted ("zero-argument :func:`super`"). In this case, *type* will be the
+ enclosing class, and *obj* will be the first argument of the immediately
+ enclosing function (typically ``self``). (This means that zero-argument
+ :func:`super` will not work within a nested function or a generator
+ expression, which implicitly creates a nested function.)
+
There are two typical use cases for *super*. In a class hierarchy with
single inheritance, *super* can be used to refer to parent classes without
naming them explicitly, thus making the code more maintainable. This use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment