From 431c4f7fc16c1b593f22ee01ef7c686cc4ec557e Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 13 Aug 2021 14:28:47 -0700 Subject: [PATCH] Improve a few types in xml.dom.minidom. (#5923) * Changes the return type of getDOMImplementation from implicit Any to DOMImplementation | None. * DOMImplementation.createDocument() and createDocumentType() allow None for all arguments. --- stdlib/xml/dom/minidom.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index 0c2c5a325..4d1d7a9d0 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -7,7 +7,7 @@ from xml.sax.xmlreader import XMLReader def parse(file: str | IO[Any], parser: XMLReader | None = ..., bufsize: int | None = ...): ... def parseString(string: str | bytes, parser: XMLReader | None = ...): ... -def getDOMImplementation(features=...): ... +def getDOMImplementation(features=...) -> DOMImplementation | None: ... class Node(xml.dom.Node): namespaceURI: str | None @@ -246,8 +246,8 @@ class Notation(Identified, Childless, Node): class DOMImplementation(DOMImplementationLS): def hasFeature(self, feature, version) -> bool: ... - def createDocument(self, namespaceURI: str, qualifiedName: str, doctype): ... - def createDocumentType(self, qualifiedName: str, publicId, systemId): ... + def createDocument(self, namespaceURI: str | None, qualifiedName: str | None, doctype): ... + def createDocumentType(self, qualifiedName: str | None, publicId, systemId): ... def getInterface(self, feature): ... class ElementInfo: