Fix mypy errors in the entire codebase #8577
Replies: 3 comments
-
|
At this point, we should switch to Python 3.9 (dropping any dependencies which are not ready) and then mypy should accept the syntax without the future import. |
Beta Was this translation helpful? Give feedback.
-
|
That would probably fail some of the checks as some files could rely on that dependency. |
Beta Was this translation helpful? Give feedback.
-
|
I suggest a phased approach for Python 3.9 migration and mypy error fixes: 1. Retain Python 3.8+ compatibility first: Keep using typing.List instead of native list[type] for now, since CI doesn’t support 3.9 yet due to dependency issues. This fixes the mypy errors and keeps the codebase stable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We need to fix all the
mypyerrors and they are increasing with the number of commits. I am planning to open an issue indicating this problem and asking for help. Some questions in my mind:list[type]or keeptyping.List? Note: We do not yet run Python 3.9 on our CI as some of the dependencies aren't compatible yet.from __future__ import annotationand usinglist[type]butmypycomplains about it:So, do we switch to Python 3.9 compatible type hints or advise users to user the
typingmodule instead?Beta Was this translation helpful? Give feedback.
All reactions