Skip to content

Commit

Permalink
Fixed type annotation of TaskGroup.start_soon()
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Aug 10, 2023
1 parent 79e53d8 commit ab5f08d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/versionhistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
**UNRELEASED**

- Added documentation on how to migrate from AnyIO 3 to 4
- Fixed the type annotation of ``TaskGroup.start_soon()`` to accept any awaitables
(already in v3.7.0 but was missing from 4.0.0rc1)

**4.0.0rc1**

Expand Down
4 changes: 2 additions & 2 deletions src/anyio/abc/_tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from abc import ABCMeta, abstractmethod
from collections.abc import Awaitable, Callable, Coroutine
from collections.abc import Awaitable, Callable
from types import TracebackType
from typing import TYPE_CHECKING, Any, Protocol, TypeVar, overload

Expand Down Expand Up @@ -42,7 +42,7 @@ class TaskGroup(metaclass=ABCMeta):
@abstractmethod
def start_soon(
self,
func: Callable[..., Coroutine[Any, Any, Any]],
func: Callable[..., Awaitable[Any]],
*args: object,
name: object = None,
) -> None:
Expand Down

0 comments on commit ab5f08d

Please sign in to comment.