Use _typeshed.Self in Python 2, too (#6932)

This commit is contained in:
Alex Waygood
2022-01-16 22:44:51 +00:00
committed by GitHub
parent 0949e9e90d
commit 6a88d5e7ae
29 changed files with 156 additions and 160 deletions

View File

@@ -1,10 +1,9 @@
import xml.dom
from typing import IO, Any, Text as _Text, TypeVar
from _typeshed import Self
from typing import IO, Any, Text as _Text
from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS
from xml.sax.xmlreader import XMLReader
_T = TypeVar("_T")
def parse(file: str | IO[Any], parser: XMLReader | None = ..., bufsize: int | None = ...): ...
def parseString(string: bytes | _Text, parser: XMLReader | None = ...): ...
def getDOMImplementation(features=...): ...
@@ -32,7 +31,7 @@ class Node(xml.dom.Node):
def setUserData(self, key, data, handler): ...
childNodes: Any
def unlink(self) -> None: ...
def __enter__(self: _T) -> _T: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, et, ev, tb) -> None: ...
class DocumentFragment(Node):