Skip to content

Commit

Permalink
Merge pull request #18 from pgjones/default
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored Dec 14, 2024
2 parents 8937bda + e62dc9f commit 2172663
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions taskgroup/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import asyncio
import collections.abc
import contextvars
from typing import Any, TypeAlias
from typing_extensions import TypeVar
from typing import Any, Optional, Union
from typing_extensions import TypeAlias, TypeVar
import sys

_YieldT_co = TypeVar("_YieldT_co", covariant=True)
Expand All @@ -15,15 +15,15 @@

_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_TaskYieldType: TypeAlias = asyncio.Future[object] | None
_TaskYieldType: TypeAlias = Optional[asyncio.Future[object]]

if sys.version_info >= (3, 12):
_TaskCompatibleCoro: TypeAlias = collections.abc.Coroutine[Any, Any, _T_co]
else:
_TaskCompatibleCoro: TypeAlias = (
collections.abc.Generator[_TaskYieldType, None, _T_co]
| collections.abc.Coroutine[Any, Any, _T_co]
)
_TaskCompatibleCoro: TypeAlias = Union[
collections.abc.Generator[_TaskYieldType, None, _T_co],
collections.abc.Coroutine[Any, Any, _T_co],
]


class _Interceptor(
Expand Down

0 comments on commit 2172663

Please sign in to comment.