Skip to content

Commit 573cfc3

Browse files
committed
Fix mypy typing errors
Errors: src/textual_dev/previews/borders.py:65: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "Sequence[tuple[Literal['', 'ascii', 'none', 'hidden', 'blank', 'round', 'solid', 'thick', 'double', 'dashed', 'heavy', 'inner', 'outer', 'hkey', 'vkey', 'tall', 'panel', 'wide'], str | Color] | None] | tuple[Literal['', 'ascii', 'none', 'hidden', 'blank', 'round', 'solid', 'thick', 'double', 'dashed', 'heavy', 'inner', 'outer', 'hkey', 'vkey', 'tall', 'panel', 'wide'], str | Color] | None") [assignment] tests/utilities/wait_for_predicate.py:29: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
1 parent 3d8db4f commit 573cfc3

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/textual_dev/previews/borders.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
from typing import cast
12
from textual.app import App, ComposeResult
23
from textual.containers import Vertical
34
from textual.css.constants import VALID_BORDER
5+
from textual.css.types import EdgeType
46
from textual.widgets import Button, Label
57

68
TEXT = """I must not fear.
@@ -60,7 +62,7 @@ def compose(self) -> ComposeResult:
6062
def on_button_pressed(self, event: Button.Pressed) -> None:
6163
self.text.border_title = event.button.id
6264
self.text.styles.border = (
63-
event.button.id,
65+
cast(EdgeType, event.button.id),
6466
self.stylesheet._variables["secondary"],
6567
)
6668

tests/utilities/wait_for_predicate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def wait_for_predicate(
2020
poll_delay_secs (float): The number of seconds to wait between each call to the
2121
predicate function.
2222
"""
23-
time_taken = 0
23+
time_taken = 0.0
2424
while True:
2525
result = predicate()
2626
if result:

0 commit comments

Comments
 (0)