| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Thanks for the proposal. I'm going to have to think about this more. This library is merged back into CPython as importlib.metadata so these annotations won't make sense when that happens. Moreover, this is the first introduction of references to importlib.metadata in this library, so I'm unsure what the implications will be. Is there any way to achieve the objectives either by:
|
Sorry, something went wrong.
|
Thanks @jaraco for the code review.
Unfortunately I don't think so. In this sense only importlib_metadata need these contrived type annotations to inform end-users that they can get back legacy objects when using the API.
I gave it a try... don't know if that is exactly what you had in mind, but I tried to do my best. I am not good with names, so if you have suggestions regarding names please let me know. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivated by #486.
This PR just provides more realistic type annotations1 to improve the type checking soundness of the package.
It does not solve #486: all the limitations are still present, but at least type checkers would help to notify users when they are trying to use new APIs that are not safe (not necessary all the time, but better than now).
It is a bit of a pain, but these annotations should be a bit more sound than they currently are.
This should also prevent future versions of this library from introducing incompatible behaviour (thanks to pytest-mypy).
Footnotes
Technically speaking, "a bit more correct". Because importlib_metadata collects 3rd-party implementations via find_distributions everything can happen. ↩