-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
markdown: add more stubs #4574
markdown: add more stubs #4574
Conversation
This makes intention clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start, hopefully we can eventually get rid of the Anys.
def run(self, parent, blocks) -> None: ... | ||
|
||
class BlockQuoteProcessor(BlockProcessor): | ||
RE: Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is a Pattern
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the changes. Not all of them are Pattern, see 8f2c0c5
I ran `fastmod 'RE: Any$' 'RE: Pattern'`. I then fixed the imports. Then I ran stubtest, which complained about a couple of those substitutions (stubgen will also type as Any if something is a str expression or alias).
We recently accepted #4426 which contributed some stubs to markdown. However, the stubs weren't complete, which results in false positives (eg, when type checking https://github.com/zulip/zulip).
Here are the rest of the stubs, as generated by
stubgen --export-less -p markdown
. I added some type ignores (where the library breaks LSP) and removedAny
type annotations so it's clearer that the annotations aren't done.