-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add missing stdlib xml stubs #5895
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
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Thank you, remarks below.
stdlib/xml/dom/pulldom.pyi
Outdated
DocumentFactory = Union[DOMImplementation, None] | ||
Node = Union[Document, Element, Text] |
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.
Since these are not available at runtime, they should be prefixed with _
.
_DocumentFactory = Union[DOMImplementation, None]
_Node = Union[Document, Element, Text]
(Same for Event
.)
stdlib/xml/dom/pulldom.pyi
Outdated
|
||
class PullDOM(ContentHandler): | ||
document: Any | None | ||
documentFactory: Any | ||
document: Union[Document, None] |
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.
Please use the new union syntax:
document: Union[Document, None] | |
document: Document | None |
(It doesn't work yet for the type aliases above.)
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.
When i use the new union syntax, some of the checks fail. Is that normal?
stdlib/xml/dom/pulldom.pyi
Outdated
def expandNode(self, node) -> None: ... | ||
def getEvent(self): ... | ||
def getEvent(self) -> _Event: ... | ||
def expand_Node(self, node: _Node) -> None: ... |
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.
Search & replace error :)
def expand_Node(self, node: _Node) -> None: ... | |
def expandNode(self, node: _Node) -> None: ... |
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.
hahahahahahhaha my bad
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Partially fixes #3787