From de301256e83f0ee1700434c3be6054948bca9b91 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 20 Oct 2021 17:44:10 +1000 Subject: [PATCH] add comment to dicts in _legacy.py --- pylib/anki/_legacy.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pylib/anki/_legacy.py b/pylib/anki/_legacy.py index 672978142..1c46bea3d 100644 --- a/pylib/anki/_legacy.py +++ b/pylib/anki/_legacy.py @@ -40,12 +40,14 @@ def _print_warning(old: str, doc: str) -> None: class DeprecatedNamesMixin: "Expose instance methods/vars as camelCase for legacy callers." + # deprecated name -> new name + _deprecated_aliases: dict[str, str] = {} + # deprecated name -> [new internal name, new name shown to user] + _deprecated_attributes: dict[str, tuple[str, str]] = {} + # the @no_type_check lines are required to prevent mypy allowing arbitrary # attributes on the consuming class - _deprecated_aliases: dict[str, str] = {} - _deprecated_attributes: dict[str, tuple[str, str]] = {} - @no_type_check def __getattr__(self, name: str) -> Any: if some_tuple := self._deprecated_attributes.get(name):