-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup a minimal mypy config #1268
Conversation
Thanks for starting this @alanhdu. If you set up In the end we'd probably run I have some knowledge of It seems to me that as we are starting the type annotations from scratch it is a good time to agree a sensible approach for how we should proceed. I am seeing annotations like var: Union[str, Dict] but I am more comfortable looking at annotations like var: str | dict In other words using |
It's a good question! I think the answer is probably not. The issue with the But since fsspec doesn't do anything with the type hints at runtime, so AFAIK there's no reason not to use the |
Ok --- pushed two commits: first commit should fix the isort problems, and the 2nd commit shows that things look like if we use |
I think it was even earlier python versions (3.6? 3.7?) that required this, especially for the case where you wanted to specialise a type like dict. |
It was 3.10: |
Rebased onto master. |
This is a first step to #625: we setups a new CI step with
mypy
and do the minimal amount of work to get it passing.Note that by default
mypy
does not type-check any function that doesn't already have type annotations in the function signature, so for now this isn't really type-checking any function internals. Still, I think having the CI setup will be a good first step.