From 2ce4d7ea26c986ab458fd985de373f09202afc0a Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 8 Oct 2020 23:05:25 +0200 Subject: [PATCH] Document limitations on `@deprecated` with multiple-inheritance. This is tricky to fix correctly and anyways quite rare, so just document the limitation for now. --- lib/matplotlib/cbook/deprecation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/matplotlib/cbook/deprecation.py b/lib/matplotlib/cbook/deprecation.py index d84709fb9373..ebea17a8bc5c 100644 --- a/lib/matplotlib/cbook/deprecation.py +++ b/lib/matplotlib/cbook/deprecation.py @@ -119,6 +119,12 @@ def deprecated(since, *, message='', name='', alternative='', pending=False, ``@staticmethod`` (i.e., `deprecated` should directly decorate the underlying callable), but *over* ``@property``. + When deprecating a class ``C`` intended to be used as a base class in a + multiple inheritance hierarchy, ``C`` *must* define an ``__init__`` method + (if ``C`` instead inherited its ``__init__`` from its own base class, then + ``@deprecated`` would mess up ``__init__`` inheritance when installing its + own (deprecation-emitting) ``C.__init__``). + Parameters ---------- since : str 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