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):