Skip to content

Commit

Permalink
Use deferred type annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed May 26, 2023
1 parent 4ba446b commit 99478b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions core/src/toga/widgets/dateinput.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime
import warnings

Expand All @@ -16,7 +18,7 @@ def __init__(
value: datetime.date | None = None,
min_date: datetime.date | None = None,
max_date: datetime.date | None = None,
on_change=None,
on_change: callable | None = None,
):
"""Create a new DateInput widget.
Expand Down Expand Up @@ -145,7 +147,7 @@ def max_date(self, value):
self._impl.set_max_date(max_date)

@property
def on_change(self):
def on_change(self) -> callable:
"""The handler to invoke when the date value changes."""
return self._on_change

Expand Down
6 changes: 4 additions & 2 deletions core/src/toga/widgets/timeinput.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime
import warnings

Expand All @@ -14,7 +16,7 @@ def __init__(
value: datetime.time | None = None,
min_time: datetime.time | None = None,
max_time: datetime.time | None = None,
on_change=None,
on_change: callable | None = None,
):
"""Create a new TimeInput widget.
Expand Down Expand Up @@ -144,7 +146,7 @@ def max_time(self, value):
self._impl.set_max_time(max_time)

@property
def on_change(self):
def on_change(self) -> callable:
"""The handler to invoke when the time value changes."""
return self._on_change

Expand Down

0 comments on commit 99478b6

Please sign in to comment.