-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
markdown: Accept legacy Pattern
in inlinePatterns
registry
#11027
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,7 +6,7 @@ from xml.etree.ElementTree import Element | |||||
from markdown import util | ||||||
from markdown.core import Markdown | ||||||
|
||||||
def build_inlinepatterns(md: Markdown, **kwargs) -> util.Registry[InlineProcessor]: ... | ||||||
def build_inlinepatterns(md: Markdown, **kwargs) -> util.Registry[Pattern]: ... | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. InlineProcessor is a subclass of Pattern and everywhere else the more general class is correct. However this particular method really does create a registry of only InlineProcessor. If the covariance stuff all works out, I believe we should leave this part as is. I'll try later today what mypy thinks about it with the full codebase
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A So if this is going to be used as |
||||||
|
||||||
NOIMG: str | ||||||
BACKTICK_RE: str | ||||||
|
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 different to the annotations the
markdown
library now has inline:Cc. @oprypin, who recently added this type hint in typeshed
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.
It is my mistake, actually this PR is more correct 👍
I was adding this both upstream and in typeshed btw.