| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 03c7cfc commit 75ea91b
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1088,9 +1088,9 @@ Basic customization | |||
| 1088 | 1088 | (usually an instance of *cls*). | |
| 1089 | 1089 | ||
| 1090 | 1090 | Typical implementations create a new instance of the class by invoking the | |
| 1091 | - superclass's :meth:`__new__` method using ``super(currentclass, | ||
| 1092 | - cls).__new__(cls[, ...])`` with appropriate arguments and then modifying the | ||
| 1093 | - newly-created instance as necessary before returning it. | ||
| 1091 | + superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` | ||
| 1092 | + with appropriate arguments and then modifying the newly-created instance | ||
| 1093 | + as necessary before returning it. | ||
| 1094 | 1094 | ||
| 1095 | 1095 | If :meth:`__new__` returns an instance of *cls*, then the new instance's | |
| 1096 | 1096 | :meth:`__init__` method will be invoked like ``__init__(self[, ...])``, where | |
@@ -1114,7 +1114,7 @@ Basic customization | |||
| 1114 | 1114 | class constructor expression. If a base class has an :meth:`__init__` | |
| 1115 | 1115 | method, the derived class's :meth:`__init__` method, if any, must explicitly | |
| 1116 | 1116 | call it to ensure proper initialization of the base class part of the | |
| 1117 | - instance; for example: ``BaseClass.__init__(self, [args...])``. | ||
| 1117 | + instance; for example: ``super().__init__([args...])``. | ||
| 1118 | 1118 | ||
| 1119 | 1119 | Because :meth:`__new__` and :meth:`__init__` work together in constructing | |
| 1120 | 1120 | objects (:meth:`__new__` to create it, and :meth:`__init__` to customize it), | |
@@ -1538,8 +1538,8 @@ Class Binding | |||
| 1538 | 1538 | ``A.__dict__['x'].__get__(None, A)``. | |
| 1539 | 1539 | ||
| 1540 | 1540 | Super Binding | |
| 1541 | - If ``a`` is an instance of :class:`super`, then the binding ``super(B, | ||
| 1542 | - obj).m()`` searches ``obj.__class__.__mro__`` for the base class ``A`` | ||
| 1541 | + If ``a`` is an instance of :class:`super`, then the binding ``super(B, obj).m()`` | ||
| 1542 | + searches ``obj.__class__.__mro__`` for the base class ``A`` | ||
| 1543 | 1543 | immediately preceding ``B`` and then invokes the descriptor with the call: | |
| 1544 | 1544 | ``A.__dict__['m'].__get__(obj, obj.__class__)``. | |
| 1545 | 1545 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments