Improve type annotations (add more and fix wrong ones)#1394
Improve type annotations (add more and fix wrong ones)#1394waylan merged 6 commits intoPython-Markdown:masterfrom
Conversation
The origins of these are three-fold: * Merging in stubs from https://github.com/python/typeshed/tree/main/stubs/Markdown using "merge-pyi" - Note: we can consider these annotations to be the important ones because it's what people have been adding according to their own need * Double-checking around places where stubs were already added from the above, particularly conflicts with annotations that got added in this repository already + Taking the opportunity to declare a generic "Registry of T" class * Running mypy and eliminating the most glaring errors it reported
|
So there appears to be a couple code changes included in this (I don't mean adjustments to whitespace/line length). Could you please remove those? They should be submitted separately. |
|
I only recognized one change that's clearly not about type annotations and reverted it. I'm not sure if you also mean the NamedTuple change (which I think is on topic, as it's just the way to spell the same thing but with type annotations) or if there was something else. |
|
I was thinking of the NameTuples, but you are correct, they do have type annotations. So nevermind on that. |
|
Thanks for this. Some of the wrong annotations I completely missed. I'll merge this after a changelog entry is added. |
|
That is done |
|
For future reference:
|
|
Note that you have a conflict with the changelog (presumably with #1392). Regarding a fully correct type-checked codebase (according to "mypy") that is probably a reasonable goal. Personally, I haven't really explored what's involved given that this is a rather new thing for Python. So contributions are welcome. |
Hm? I had already merged to resolve the conflict. There was just the spelling check failing
Great, so I'll continue looking into this soon (in a separate PR) |
|
This PR almost closes #1389 🙂 |
|
Oh I didn't see that! |
|
Oh OK I thought there was just the |
The origins of these are three-fold: