Remove unused _DeferredTranslation methods and references (#3557)

This commit is contained in:
correctmost 2025-05-31 06:04:23 +00:00 committed by GitHub
parent e245a11463
commit a1b83ad29f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 17 deletions

View File

@ -19,7 +19,7 @@ class ListManager[ValueT]:
):
"""
:param prompt: Text which will appear at the header
type param: string | DeferredTranslation
type param: string
:param entries: list/dict of option to be shown / manipulated
type param: list

View File

@ -163,9 +163,6 @@ class _DeferredTranslation:
def __init__(self, message: str):
self.message = message
def __len__(self) -> int:
return len(self.message)
@override
def __str__(self) -> str:
if builtins._ is _DeferredTranslation: # type: ignore[attr-defined]
@ -175,19 +172,6 @@ class _DeferredTranslation:
# Language.activate() is called
return builtins._(self.message) # type: ignore[attr-defined]
def __lt__(self, other) -> bool:
return self.message < other
def __gt__(self, other) -> bool:
return self.message > other
def __add__(self, other) -> _DeferredTranslation:
if isinstance(other, str):
other = _DeferredTranslation(other)
concat = self.message + other.message
return _DeferredTranslation(concat)
def tr(message: str) -> str:
return str(_DeferredTranslation(message))