Skip to content

xml.dom.minidom: add missing type annotation of Element.getAttribute #8350

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 1 commit into from
Jul 21, 2022

Conversation

tetsuok
Copy link
Contributor

@tetsuok tetsuok commented Jul 21, 2022

This PR adds missing type annotation of Element.getAttribute method. This is to avoid getting error: Call to untyped function "getAttribute" in typed context when we run mypy against the code which calls the method.
According to Document Object Model (DOM) Level 1 Specification, getAttribute takes a attribute name in string, and returns a string:

interface Element : Node {
  ...
  DOMString                 getAttribute(in DOMString name);
  ...
}

@github-actions
Copy link
Contributor

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

@srittau srittau merged commit 10bc4b0 into python:master Jul 21, 2022
@tetsuok tetsuok deleted the add-type-annotation-xml-dom-minidom branch July 21, 2022 06:19
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.

2 participants