Skip to content

Commit 70f42d7

Browse files
authored
Merge pull request #6152 from uriyyo/bugfix/app-import
Use alias _App for App in type hints under TYPE_CHECKING
2 parents a48a558 + 49fc78d commit 70f42d7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2424

2525
- Fix inability to copy text outside of an input/textarea when it was focused https://github.com/Textualize/textual/pull/6148
2626
- Fix issue when copying text after a double click https://github.com/Textualize/textual/pull/6148
27+
- Fixed type hint aliasing for App under TYPE_CHECKING https://github.com/Textualize/textual/pull/6152
2728

2829
## [6.2.0] - 2025-09-30
2930

src/textual/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
if TYPE_CHECKING:
3737
from importlib.metadata import version
3838

39-
from textual.app import App
39+
from textual.app import App as _App
4040

4141
__version__ = version("textual")
4242
"""The version of Textual."""
@@ -65,15 +65,15 @@ def __init__(
6565
log_callable: LogCallable | None,
6666
group: LogGroup = LogGroup.INFO,
6767
verbosity: LogVerbosity = LogVerbosity.NORMAL,
68-
app: App | None = None,
68+
app: _App | None = None,
6969
) -> None:
7070
self._log = log_callable
7171
self._group = group
7272
self._verbosity = verbosity
7373
self._app = None if app is None else weakref.ref(app)
7474

7575
@property
76-
def app(self) -> App | None:
76+
def app(self) -> _App | None:
7777
"""The associated application, or `None` if there isn't one."""
7878
return None if self._app is None else self._app()
7979

0 commit comments

Comments
 (0)