Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e6d87e

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

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)

[8]ページ先頭

©2009-2025 Movatter.jp