mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Use _ReadableStream from codecs (#13167)
This commit is contained in:
committed by
GitHub
parent
cb15f9e832
commit
9d743a3f1e
@@ -1,5 +1,6 @@
|
||||
from codecs import _ReadableStream, _WritableStream
|
||||
from collections.abc import Callable, Mapping, Sequence
|
||||
from typing import Any, ClassVar, Literal, Protocol
|
||||
from typing import Any, ClassVar, Literal
|
||||
from typing_extensions import Self
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
@@ -7,18 +8,6 @@ from . import blockparser, inlinepatterns, postprocessors, preprocessors, treepr
|
||||
from .extensions import Extension
|
||||
from .util import HtmlStash, Registry
|
||||
|
||||
# TODO: The following protocols can be replaced by their counterparts from
|
||||
# codecs, once they have been propagated to all type checkers.
|
||||
class _WritableStream(Protocol):
|
||||
def write(self, data: bytes, /) -> object: ...
|
||||
def seek(self, offset: int, whence: int, /) -> object: ...
|
||||
def close(self) -> object: ...
|
||||
|
||||
class _ReadableStream(Protocol):
|
||||
def read(self, size: int = ..., /) -> bytes: ...
|
||||
def seek(self, offset: int, whence: int, /) -> object: ...
|
||||
def close(self) -> object: ...
|
||||
|
||||
class Markdown:
|
||||
preprocessors: Registry[preprocessors.Preprocessor]
|
||||
inlinePatterns: Registry[inlinepatterns.Pattern]
|
||||
|
||||
Reference in New Issue
Block a user