From 4ae9a9cafc9d43c569e7a2a343208654ff0917bb Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Thu, 18 Aug 2022 09:55:01 -0400 Subject: [PATCH 1/3] fix: add missing type stubs for minidom.DOMImplementation --- stdlib/xml/dom/minidom.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index 7645bd79e9c1..3413854a993c 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -1,6 +1,6 @@ import sys import xml.dom -from _typeshed import Self, SupportsRead +from _typeshed import Incomplete, Self, SupportsRead from typing import Any from typing_extensions import Literal from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS @@ -265,10 +265,10 @@ class Notation(Identified, Childless, Node): def __init__(self, name, publicId, systemId) -> None: ... class DOMImplementation(DOMImplementationLS): - def hasFeature(self, feature, version) -> bool: ... - def createDocument(self, namespaceURI: str | None, qualifiedName: str | None, doctype): ... - def createDocumentType(self, qualifiedName: str | None, publicId, systemId): ... - def getInterface(self, feature): ... + def hasFeature(self, feature: str, version: str | None) -> bool: ... + def createDocument(self, namespaceURI: str | None, qualifiedName: str | None, doctype: DocumentType | None) -> Document: ... + def createDocumentType(self, qualifiedName: str | None, publicId: Incomplete, systemId: Incomplete) -> Incomplete: ... + def getInterface(self: Self, feature: str) -> Self | None: ... class ElementInfo: tagName: Any From bb644dc7d3aa6b3c125cbc46a067d16334e1a424 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Sat, 20 Aug 2022 15:20:59 -0400 Subject: [PATCH 2/3] Replace `Incomplete` with accurate types in `createDocumentType` Co-authored-by: Alex Waygood --- stdlib/xml/dom/minidom.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index 3413854a993c..ea6d08cc2c64 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -267,7 +267,7 @@ class Notation(Identified, Childless, Node): class DOMImplementation(DOMImplementationLS): def hasFeature(self, feature: str, version: str | None) -> bool: ... def createDocument(self, namespaceURI: str | None, qualifiedName: str | None, doctype: DocumentType | None) -> Document: ... - def createDocumentType(self, qualifiedName: str | None, publicId: Incomplete, systemId: Incomplete) -> Incomplete: ... + def createDocumentType(self, qualifiedName: str | None, publicId: str, systemId: str) -> DocumentType: ... def getInterface(self: Self, feature: str) -> Self | None: ... class ElementInfo: From a35d0309da677535596aabe467dfb765d0eda452 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 19:22:05 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/xml/dom/minidom.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index ea6d08cc2c64..f7663165fb59 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -1,6 +1,6 @@ import sys import xml.dom -from _typeshed import Incomplete, Self, SupportsRead +from _typeshed import Self, SupportsRead from typing import Any from typing_extensions import Literal from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS