mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
asyncio: fix task factory types (#11993)
This commit is contained in:
13
stdlib/@tests/test_cases/asyncio/check_task_factory.py
Normal file
13
stdlib/@tests/test_cases/asyncio/check_task_factory.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
|
||||
def get_set(loop: asyncio.BaseEventLoop) -> None:
|
||||
loop.set_task_factory(loop.get_task_factory())
|
||||
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
|
||||
def eager(loop: asyncio.BaseEventLoop) -> None:
|
||||
loop.set_task_factory(asyncio.eager_task_factory)
|
||||
loop.set_task_factory(asyncio.create_eager_task_factory(asyncio.Task))
|
||||
Reference in New Issue
Block a user