Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit 232cdae

Browse files
committed
Relax constraints on the Token type
1 parent 7b5edf6 commit 232cdae

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cli_ui/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
_INITIALIZED = False
4545

4646

47-
Token = Union[str, "Color", "UnicodeSequence", "Symbol"]
47+
# Tokens can be strings, or Color, UnicodeSequence or Symbol instances,
48+
# or anything that can be converted to string.
49+
Token = Any
4850

4951

5052
def setup(
@@ -460,7 +462,7 @@ def read_password() -> str:
460462

461463

462464
def get_ask_tokens(tokens: Sequence[Token]) -> List[Token]:
463-
return [green, "::", reset] + list(tokens) + [reset] # type: ignore
465+
return [green, "::", reset] + list(tokens) + [reset]
464466

465467

466468
def ask_string(*question: Token, default: Optional[str] = None) -> Optional[str]:
@@ -542,7 +544,7 @@ def ask_yes_no(*question: Token, default: bool = False) -> bool:
542544
tokens.append("(Y/n)")
543545
else:
544546
tokens.append("(y/N)")
545-
info(*tokens) # type: ignore
547+
info(*tokens)
546548
answer = read_input()
547549
if answer.lower() in ["y", "yes"]:
548550
return True

0 commit comments

Comments
 (0)