mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
add comment to dicts in _legacy.py
This commit is contained in:
parent
54df350cda
commit
de301256e8
1 changed files with 5 additions and 3 deletions
|
@ -40,12 +40,14 @@ def _print_warning(old: str, doc: str) -> None:
|
||||||
class DeprecatedNamesMixin:
|
class DeprecatedNamesMixin:
|
||||||
"Expose instance methods/vars as camelCase for legacy callers."
|
"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
|
# the @no_type_check lines are required to prevent mypy allowing arbitrary
|
||||||
# attributes on the consuming class
|
# attributes on the consuming class
|
||||||
|
|
||||||
_deprecated_aliases: dict[str, str] = {}
|
|
||||||
_deprecated_attributes: dict[str, tuple[str, str]] = {}
|
|
||||||
|
|
||||||
@no_type_check
|
@no_type_check
|
||||||
def __getattr__(self, name: str) -> Any:
|
def __getattr__(self, name: str) -> Any:
|
||||||
if some_tuple := self._deprecated_attributes.get(name):
|
if some_tuple := self._deprecated_attributes.get(name):
|
||||||
|
|
Loading…
Reference in a new issue