xml: improve bytes types (#9110)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
Jelle Zijlstra
2022-11-10 20:43:26 -08:00
committed by GitHub
parent 294b03f75b
commit ec4ec33639
5 changed files with 27 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
import sys
from _typeshed import SupportsRead, _T_co
from _typeshed import ReadableBuffer, SupportsRead, _T_co
from collections.abc import Iterable
from typing import Any, NoReturn, Protocol
from xml.sax.handler import ContentHandler as ContentHandler, ErrorHandler as ErrorHandler
@@ -36,5 +36,5 @@ else:
def parse(
source: str | _SupportsReadClose[bytes] | _SupportsReadClose[str], handler: ContentHandler, errorHandler: ErrorHandler = ...
) -> None: ...
def parseString(string: bytes | str, handler: ContentHandler, errorHandler: ErrorHandler | None = ...) -> None: ...
def parseString(string: ReadableBuffer | str, handler: ContentHandler, errorHandler: ErrorHandler | None = ...) -> None: ...
def _create_parser(parser_name: str) -> XMLReader: ...