| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
from __future__ import annotations is implicitly enabled in stub files, so we can just use builtin type instead of typing.Type — this is what the flake8 error message was trying to flag.
(Do you have any feedback for how we could improve that flake8 error message, btw? 🙂)
Sorry, something went wrong.
|
I have opened PyCQA/flake8-pyi#164 — we can definitely improve that error message :) As the person who, er, wrote the error message, I sincerely apologise for the confusion!! |
Sorry, something went wrong.
The FileFinder takes a tuple of (class, arguments) to instantiate for each time, rather than an existing instance. This fixes the type hint to match Python 3.10 reality. Issue: #7085
Perhaps Y022 It is preferred to use type[C] over typing.Type[C] |
Sorry, something went wrong.
|
Anyhow, I've squashed away the evidence of my confusion, and it should pass the lints now, thanks for your help! |
Sorry, something went wrong.
No problem!! |
Sorry, something went wrong.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
|
As for how I ended up here, due to some arguments and a slight insomnia I ended up writing a Python module to enforce type hints on all imports at run-time and not as a CI step. It turns out it ended up shooting itself as the importlib types didn't match reality <.< But once that was fixed, it actually works, with only slight side-effects (may include nausea, sluggishness and ImportErrors.) |
Sorry, something went wrong.
|
Thank you! (And thanks Alex for improving the message) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The FileFinder takes a tuple of (class, arguments) to instantiate for
each time, rather than an existing instance.
This fixes the type hint to match Python 3.10 reality.
Issue: #7085