Commit 0a68b01d authored by Raymond Hettinger's avatar Raymond Hettinger

More markup and spelling fixes.

parent 79d0434a
...@@ -1050,19 +1050,19 @@ are always available. They are listed here in alphabetical order. ...@@ -1050,19 +1050,19 @@ are always available. They are listed here in alphabetical order.
been overridden in a class. The search order is same as that used by been overridden in a class. The search order is same as that used by
:func:`getattr` except that the *type* itself is skipped. :func:`getattr` except that the *type* itself is skipped.
The ``__mro__`` attribute of the *type* lists the method resolution search The :attr:`__mro__` attribute of the *type* lists the method resolution
order used by both :func:`getattr` and :func:`super`. The attribue is search order used by both :func:`getattr` and :func:`super`. The attribute
dynamic and can change whenever the inheritance hierarchy is updated. is dynamic and can change whenever the inheritance hierarchy is updated.
If the second argument is omitted, the super object returned is unbound. If If the second argument is omitted, the super object returned is unbound. If
the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is an object, ``isinstance(obj, type)`` must be true. If
the second argument is a type, ``issubclass(type2, type)`` must be true (this the second argument is a type, ``issubclass(type2, type)`` must be true (this
is useful for classmethods). is useful for classmethods).
There are two typical use cases for "super". In a class hierarchy with 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 single inheritance, *super* can be used to refer to parent classes without
naming them explicitly, thus making the code more maintainable. This use naming them explicitly, thus making the code more maintainable. This use
closely parallels the use of "super" in other programming languages. closely parallels the use of *super* in other programming languages.
The second use case is to support cooperative multiple inheritance in a The second use case is to support cooperative multiple inheritance in a
dynamic execution environment. This use case is unique to Python and is dynamic execution environment. This use case is unique to Python and is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment