Skip to content

Added: None Overload #4722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions stdlib/3/email/utils.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import sys
from email.charset import Charset
from typing import List, Optional, Tuple, Union
from typing import List, Optional, Tuple, Union, overload

_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]]
_PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]]
Expand All @@ -10,9 +11,24 @@ def unquote(str: str) -> str: ...
def parseaddr(address: Optional[str]) -> Tuple[str, str]: ...
def formataddr(pair: Tuple[Optional[str], str], charset: Union[str, Charset] = ...) -> str: ...
def getaddresses(fieldvalues: List[str]) -> List[Tuple[str, str]]: ...
@overload
def parsedate(date: None) -> None: ...
@overload
def parsedate(date: str) -> Optional[Tuple[int, int, int, int, int, int, int, int, int]]: ...
@overload
def parsedate_tz(date: None) -> None: ...
@overload
def parsedate_tz(date: str) -> Optional[_PDTZ]: ...
def parsedate_to_datetime(date: str) -> datetime.datetime: ...

if sys.version_info >= (3, 10):
@overload
def parsedate_to_datetime(date: None) -> None: ...
@overload
def parsedate_to_datetime(date: str) -> datetime.datetime: ...

else:
def parsedate_to_datetime(date: str) -> datetime.datetime: ...

def mktime_tz(tuple: _PDTZ) -> int: ...
def formatdate(timeval: Optional[float] = ..., localtime: bool = ..., usegmt: bool = ...) -> str: ...
def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ...
Expand Down