-
Notifications
You must be signed in to change notification settings - Fork 18
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
type annotations for metainfo #56
base: master
Are you sure you want to change the base?
Conversation
typing_extensions dependency is not required. Type checkers assume it's present in stub files regardless so you can use it without depending on it |
I have only given it a quick look, I'll review it in depth soon. |
The typing part looks good to me (after you handle the requested changes), although @rndusr will still have to check if the structure defined by the typed dict matches the runtime |
I tried to go through and ctrl+f for different keys being added/removed, but i am sure that i missed some. sorry if i did! mypy doesn't complain at least? |
don't worry, not saying you've got it wrong. I'm just not too familiar with the runtime semantics of metainfo to make a good judgement. |
Hello :)
Very simple little PR, took me awhile to get a sense of the structure of the metainfo object, so thought i might as well contribute some type annotations for it.
typing_extensions
dep is for theRequired
/NotRequired
/total
syntax which is only in >3.11, that's necessary to model the "anything can be in there but these are the keys that are usually in there" structure of that dict.