Skip to content

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

Merged
merged 37 commits into from
Aug 9, 2021
Merged

Add missing stdlib xml stubs #5895

merged 37 commits into from
Aug 9, 2021

Conversation

stackswithans
Copy link
Contributor

Partially fixes #3787

@github-actions

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a 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.

Comment on lines 16 to 17
DocumentFactory = Union[DOMImplementation, None]
Node = Union[Document, Element, Text]
Copy link
Collaborator

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.)


class PullDOM(ContentHandler):
document: Any | None
documentFactory: Any
document: Union[Document, None]
Copy link
Collaborator

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:

Suggested change
document: Union[Document, None]
document: Document | None

(It doesn't work yet for the type aliases above.)

Copy link
Contributor Author

@stackswithans stackswithans Aug 9, 2021

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?

@stackswithans stackswithans requested a review from srittau August 9, 2021 20:17
def expandNode(self, node) -> None: ...
def getEvent(self): ...
def getEvent(self) -> _Event: ...
def expand_Node(self, node: _Node) -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search & replace error :)

Suggested change
def expand_Node(self, node: _Node) -> None: ...
def expandNode(self, node: _Node) -> None: ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahahahahahhaha my bad

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2021

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 32a6257 into python:master Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing standard library xml
2 participants