mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
email.generator: Use protocols instead of TextIO/BinaryIO (#7082)
This commit is contained in:
@@ -1,27 +1,37 @@
|
||||
from _typeshed import SupportsWrite
|
||||
from email.message import Message
|
||||
from email.policy import Policy
|
||||
from typing import BinaryIO, TextIO
|
||||
|
||||
class Generator:
|
||||
def clone(self, fp: TextIO) -> Generator: ...
|
||||
def clone(self, fp: SupportsWrite[str]) -> Generator: ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def __init__(
|
||||
self, outfp: TextIO, mangle_from_: bool | None = ..., maxheaderlen: int | None = ..., *, policy: Policy | None = ...
|
||||
self,
|
||||
outfp: SupportsWrite[str],
|
||||
mangle_from_: bool | None = ...,
|
||||
maxheaderlen: int | None = ...,
|
||||
*,
|
||||
policy: Policy | None = ...,
|
||||
) -> None: ...
|
||||
def flatten(self, msg: Message, unixfrom: bool = ..., linesep: str | None = ...) -> None: ...
|
||||
|
||||
class BytesGenerator:
|
||||
def clone(self, fp: BinaryIO) -> BytesGenerator: ...
|
||||
def clone(self, fp: SupportsWrite[bytes]) -> BytesGenerator: ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def __init__(
|
||||
self, outfp: BinaryIO, mangle_from_: bool | None = ..., maxheaderlen: int | None = ..., *, policy: Policy | None = ...
|
||||
self,
|
||||
outfp: SupportsWrite[bytes],
|
||||
mangle_from_: bool | None = ...,
|
||||
maxheaderlen: int | None = ...,
|
||||
*,
|
||||
policy: Policy | None = ...,
|
||||
) -> None: ...
|
||||
def flatten(self, msg: Message, unixfrom: bool = ..., linesep: str | None = ...) -> None: ...
|
||||
|
||||
class DecodedGenerator(Generator):
|
||||
def __init__(
|
||||
self,
|
||||
outfp: TextIO,
|
||||
outfp: SupportsWrite[str],
|
||||
mangle_from_: bool | None = ...,
|
||||
maxheaderlen: int | None = ...,
|
||||
fmt: str | None = ...,
|
||||
|
||||
Reference in New Issue
Block a user