-
Notifications
You must be signed in to change notification settings - Fork 123
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
Stricter type hint linting #332
Comments
@l0b0 in #309 I actually moved to Pyright as the type checker, as mypy was having trouble inferring types and allowing some of the techniques I deployed there. I'd be interested if mypy could work with the current typing approach with stricter configuration options without significant changes to the approach. I forget exactly what mypy was erroring on, but if you run default mypy against #309 you'll see some errors that I believe would take some deeper changes to how we're structuring types, or creating a lot more lines of code, where Pyright is able to type check successfully. |
There are 46 errors in the pystac directory, so I'm afraid you'd have to be more specific. |
That's the issue - mypy reports 46 errors where pyright declares it type correct, and I tend to agree with pyright. |
I've addressed the |
Closed via #337 |
Should this actually be closed though @duckontheweb? I haven't got around to introducing the stricter checks mentioned in the original post. |
As a last step in this process I'm working towards |
Looks like this was fixed by @duckontheweb in #591. Can this be closed? |
Yes, thanks for all your work on this @l0b0! |
Would you be interested in stricter type hint linting? I've implemented these additional mypy settings in another project already:
None
by not implicitly making their typeOptional
." Basically, declaring a parameterfoo: str = None
becomes an error, rather than being implicitly treated asOptional[str]
.type: ignore[SPECIFIER]
comments (which are more specific than the big hammer,type: ignore
), since theSPECIFIER
part of that is part of the error message.Any
from a function declared with a non-Any
return type."# type: ignore
comments."I've also avoided
ignore_missing_imports
simply by marking only a handful of specific imports as ignored.The text was updated successfully, but these errors were encountered: