Skip to content

Using mypy with Python >= 3.9 reports errors #1168

@haakonvt

Description

@haakonvt
cognite/client/utils/_concurrency.py:229: error: Incompatible types in
assignment (expression has type "ThreadPoolExecutor", variable has type
"TaskExecutor")  [assignment]
                executor: TaskExecutor = _THREAD_POOL_EXECUTOR_SINGLETON
                                         ^
cognite/client/utils/_concurrency.py:229: note: Following member(s) of "ThreadPoolExecutor" have conflicts:
cognite/client/utils/_concurrency.py:229: note:     Expected:
cognite/client/utils/_concurrency.py:229: note:         def [T_Result] submit(self, fn: Callable[..., T_Result], *args: Any, **kwargs: Any) -> TaskFuture[T_Result]
cognite/client/utils/_concurrency.py:229: note:     Got:
cognite/client/utils/_concurrency.py:229: note:         def [_P`-1, _T] submit(self, Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]
cognite/client/utils/_concurrency.py:232: error: Incompatible types in
assignment (expression has type "ThreadPoolExecutor", variable has type
"TaskExecutor")  [assignment]
                executor = _THREAD_POOL_EXECUTOR_SINGLETON = ThreadPoolExe...
                ^
cognite/client/utils/_concurrency.py:232: note: Following member(s) of "ThreadPoolExecutor" have conflicts:
cognite/client/utils/_concurrency.py:232: note:     Expected:
cognite/client/utils/_concurrency.py:232: note:         def [T_Result] submit(self, fn: Callable[..., T_Result], *args: Any, **kwargs: Any) -> TaskFuture[T_Result]
cognite/client/utils/_concurrency.py:232: note:     Got:
cognite/client/utils/_concurrency.py:232: note:         def [_P`-1, _T] submit(self, Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]
Found 2 errors in 1 file (checked 80 source files)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions