Skip to content

Commit 8e6d87e

Browse files
authored
Merge pull request #18694 from anntzer/deprecated-mi
DOC: Document limitations on `@deprecated` with multiple-inheritance.
2 parents ef9b1e9 + 2ce4d7e commit 8e6d87e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/cbook/deprecation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ def deprecated(since, *, message='', name='', alternative='', pending=False,
119119
``@staticmethod`` (i.e., `deprecated` should directly decorate the
120120
underlying callable), but *over* ``@property``.
121121
122+
When deprecating a class ``C`` intended to be used as a base class in a
123+
multiple inheritance hierarchy, ``C`` *must* define an ``__init__`` method
124+
(if ``C`` instead inherited its ``__init__`` from its own base class, then
125+
``@deprecated`` would mess up ``__init__`` inheritance when installing its
126+
own (deprecation-emitting) ``C.__init__``).
127+
122128
Parameters
123129
----------
124130
since : str

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy