mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use _typeshed.Self with __enter__ (#5723)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz> Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import sys
|
||||
import xml.dom
|
||||
from typing import IO, Any, Optional, TypeVar, Union
|
||||
from _typeshed import Self
|
||||
from typing import IO, Any, Optional, Union
|
||||
from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS
|
||||
from xml.sax.xmlreader import XMLReader
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def parse(file: Union[str, IO[Any]], parser: Optional[XMLReader] = ..., bufsize: Optional[int] = ...): ...
|
||||
def parseString(string: Union[str, bytes], parser: Optional[XMLReader] = ...): ...
|
||||
def getDOMImplementation(features=...): ...
|
||||
@@ -39,7 +38,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):
|
||||
|
||||
Reference in New Issue
Block a user