Skip to content

Commit 83b11e7

Browse files
committed
Modernize type annotations
1 parent 72c7184 commit 83b11e7

2 files changed

Lines changed: 119 additions & 125 deletions

File tree

temporalio/activity.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
TYPE_CHECKING,
2424
Any,
2525
NoReturn,
26+
Type,
2627
overload,
2728
)
2829

@@ -579,8 +580,8 @@ def must_from_callable(fn: Callable) -> _Definition:
579580

580581
@classmethod
581582
def get_name_and_result_type(
582-
cls, name_or_run_fn: Union[str, Callable[..., Any]]
583-
) -> Tuple[str, Optional[Type]]:
583+
cls, name_or_run_fn: str | Callable[..., Any]
584+
) -> tuple[str, Type | None]:
584585
if isinstance(name_or_run_fn, str):
585586
return name_or_run_fn, None
586587
elif callable(name_or_run_fn):

0 commit comments

Comments
 (0)