Skip to content

TypeError: 'type' object is not subscriptable in python 3.8 #29

@danielyan86129

Description

@danielyan86129

After install 0.2.1, from taskgroup import TaskGroup as AsyncioTaskGroup will fail with this error:

(py38) ➜  ~ python3                                
Python 3.8.19 (default, Mar 20 2024, 19:58:24) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from taskgroup import TaskGroup as AsyncioTaskGroup
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yajieyan/miniconda3/envs/py38/lib/python3.8/site-packages/taskgroup/__init__.py", line 9, in <module>
    from .runners import run, Runner
  File "/home/yajieyan/miniconda3/envs/py38/lib/python3.8/site-packages/taskgroup/runners.py", line 22, in <module>
    from .tasks import task_factory as _task_factory
  File "/home/yajieyan/miniconda3/envs/py38/lib/python3.8/site-packages/taskgroup/tasks.py", line 18, in <module>
    _TaskYieldType: TypeAlias = Optional[asyncio.Future[object]]
TypeError: 'type' object is not subscriptable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions