Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions stdlib/xml/dom/minidom.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import sys
import xml.dom
from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite
from typing import NoReturn, TypeVar
from typing_extensions import Literal, Self
from xml.dom.minicompat import NodeList
from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS
from xml.sax.xmlreader import XMLReader

_N = TypeVar("_N", bound=Node)

def parse(file: str | SupportsRead[ReadableBuffer | str], parser: XMLReader | None = None, bufsize: int | None = None): ...
def parseString(string: str | ReadableBuffer, parser: XMLReader | None = None): ...
def getDOMImplementation(features=None) -> DOMImplementation | None: ...
Expand Down Expand Up @@ -34,7 +38,7 @@ class Node(xml.dom.Node):

def hasChildNodes(self) -> bool: ...
def insertBefore(self, newChild, refChild): ...
def appendChild(self, node): ...
def appendChild(self, node: _N) -> _N: ...
def replaceChild(self, newChild, oldChild): ...
def removeChild(self, oldChild): ...
def normalize(self) -> None: ...
Expand Down Expand Up @@ -143,7 +147,7 @@ class Element(Node):
removeAttributeNodeNS: Incomplete
def hasAttribute(self, name: str) -> bool: ...
def hasAttributeNS(self, namespaceURI: str, localName) -> bool: ...
def getElementsByTagName(self, name: str): ...
def getElementsByTagName(self, name: str) -> NodeList[Node]: ...
def getElementsByTagNameNS(self, namespaceURI: str, localName): ...
def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ...
def hasAttributes(self) -> bool: ...
Expand All @@ -158,12 +162,12 @@ class Childless:
childNodes: Incomplete
firstChild: Incomplete
lastChild: Incomplete
def appendChild(self, node) -> None: ...
def appendChild(self, node) -> NoReturn: ...
def hasChildNodes(self) -> bool: ...
def insertBefore(self, newChild, refChild) -> None: ...
def removeChild(self, oldChild) -> None: ...
def insertBefore(self, newChild, refChild) -> NoReturn: ...
def removeChild(self, oldChild) -> NoReturn: ...
def normalize(self) -> None: ...
def replaceChild(self, newChild, oldChild) -> None: ...
def replaceChild(self, newChild, oldChild) -> NoReturn: ...

class ProcessingInstruction(Childless, Node):
nodeType: int
Expand Down Expand Up @@ -254,10 +258,10 @@ class Entity(Identified, Node):
notationName: Incomplete
childNodes: Incomplete
def __init__(self, name, publicId, systemId, notation) -> None: ...
def appendChild(self, newChild) -> None: ...
def insertBefore(self, newChild, refChild) -> None: ...
def removeChild(self, oldChild) -> None: ...
def replaceChild(self, newChild, oldChild) -> None: ...
def appendChild(self, newChild) -> NoReturn: ...
def insertBefore(self, newChild, refChild) -> NoReturn: ...
def removeChild(self, oldChild) -> NoReturn: ...
def replaceChild(self, newChild, oldChild) -> NoReturn: ...

class Notation(Identified, Childless, Node):
nodeType: int
Expand Down Expand Up @@ -300,7 +304,7 @@ class Document(Node, DocumentLS):
doctype: DocumentType | None
childNodes: Incomplete
def __init__(self) -> None: ...
def appendChild(self, node): ...
def appendChild(self, node: _N) -> _N: ...
documentElement: Incomplete
def removeChild(self, oldChild): ...
def unlink(self) -> None: ...
Expand All @@ -315,7 +319,7 @@ class Document(Node, DocumentLS):
def createElementNS(self, namespaceURI: str, qualifiedName: str): ...
def createAttributeNS(self, namespaceURI: str, qualifiedName: str) -> Attr: ...
def getElementById(self, id): ...
def getElementsByTagName(self, name: str): ...
def getElementsByTagName(self, name: str) -> NodeList[Node]: ...
def getElementsByTagNameNS(self, namespaceURI: str, localName): ...
def isSupported(self, feature: str, version: str | None) -> bool: ...
def importNode(self, node, deep): ...
Expand Down