fix(core): address Pylance complains [no changelog]
What changed, and why it matters
This commit is a minor code cleanup that only changes how Python type-hinting overloads are ordered and how a multi-line import is formatted. It does not change any actual program behavior, user-facing text, security checks, or hardware wallet logic. There is no security relevance.
No action needed; this is a non-functional style/refactor commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adjusts two files in the Trezor Core UI layout code. In bolt/init.py it collapses a parenthesized multi-line import into a single line. In properties.py it reorders the @overload declarations for with_colon and maybe_with_colon so the None overload comes last instead of first. These are purely stylistic/typing-tool (Pylance) compliance changes with no runtime effect.
Changed components
core/src/trezor/ui/layouts/bolt/__init__.pycore/src/trezor/ui/layouts/properties.pyInspect captured patch +5 / −10
diff --git a/core/src/trezor/ui/layouts/bolt/__init__.py b/core/src/trezor/ui/layouts/bolt/__init__.py
index 0267d4f4..fe8deeda 100644
--- a/core/src/trezor/ui/layouts/bolt/__init__.py
+++ b/core/src/trezor/ui/layouts/bolt/__init__.py
@@ -6,12 +6,7 @@ from trezor import TR, ui, utils
from trezor.enums import ButtonRequestType, RecoveryType
from trezor.wire import ActionCancelled
-from ..common import (
- interact,
- interact_simple,
- raise_if_not_confirmed,
- with_info,
-)
+from ..common import interact, interact_simple, raise_if_not_confirmed, with_info
from ..properties import with_colon
if TYPE_CHECKING:
diff --git a/core/src/trezor/ui/layouts/properties.py b/core/src/trezor/ui/layouts/properties.py
index 53ce25f4..116f7f09 100644
--- a/core/src/trezor/ui/layouts/properties.py
+++ b/core/src/trezor/ui/layouts/properties.py
@@ -7,21 +7,21 @@ if TYPE_CHECKING:
from .common import StrPropertyType
- @overload
- def with_colon(properties: None) -> None: ...
@overload
def with_colon(properties: Iterable[StrPropertyType]) -> list[StrPropertyType]: ...
@overload
def with_colon(properties: str) -> str: ...
-
@overload
- def maybe_with_colon(properties: None) -> None: ...
+ def with_colon(properties: None) -> None: ...
+
@overload
def maybe_with_colon(
properties: Iterable[StrPropertyType],
) -> list[StrPropertyType]: ...
@overload
def maybe_with_colon(properties: str) -> str: ...
+ @overload
+ def maybe_with_colon(properties: None) -> None: ...
class AboveThreshold:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.