mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Re-organize directory structure (#4971)
See discussion in #2491 Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
21
stdlib/email/feedparser.pyi
Normal file
21
stdlib/email/feedparser.pyi
Normal file
@@ -0,0 +1,21 @@
|
||||
from email.message import Message
|
||||
from email.policy import Policy
|
||||
from typing import Callable, Generic, TypeVar, overload
|
||||
|
||||
_M = TypeVar("_M", bound=Message)
|
||||
|
||||
class FeedParser(Generic[_M]):
|
||||
@overload
|
||||
def __init__(self: FeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, _factory: Callable[[], _M], *, policy: Policy = ...) -> None: ...
|
||||
def feed(self, data: str) -> None: ...
|
||||
def close(self) -> _M: ...
|
||||
|
||||
class BytesFeedParser(Generic[_M]):
|
||||
@overload
|
||||
def __init__(self: BytesFeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, _factory: Callable[[], _M], *, policy: Policy = ...) -> None: ...
|
||||
def feed(self, data: bytes) -> None: ...
|
||||
def close(self) -> _M: ...
|
||||
Reference in New Issue
Block a user