Change return type of Message.get_payload() to Any (#3504)

If, for example, is_multipart() is called before calling get_payload(),
it is guaranteed that a List[Message] is returned.
This commit is contained in:
Sebastian Rittau
2019-11-26 17:03:15 +01:00
committed by Jelle Zijlstra
parent 643b955edb
commit 595d02363a

View File

@@ -26,7 +26,7 @@ class Message:
def set_unixfrom(self, unixfrom: str) -> None: ...
def get_unixfrom(self) -> Optional[str]: ...
def attach(self, payload: Message) -> None: ...
def get_payload(self, i: int = ..., decode: bool = ...) -> Optional[_PayloadType]: ...
def get_payload(self, i: int = ..., decode: bool = ...) -> Any: ... # returns Optional[_PayloadType]
def set_payload(self, payload: _PayloadType,
charset: _CharsetType = ...) -> None: ...
def set_charset(self, charset: _CharsetType) -> None: ...