Skip to content

implement some minor 3.7 features #1966

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
Mar 22, 2018
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion stdlib/2and3/binascii.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ else:
_Ascii = Union[bytes, Text]

def a2b_uu(string: _Ascii) -> bytes: ...
def b2a_uu(data: _Bytes) -> bytes: ...
if sys.version_info >= (3, 7):
def b2a_uu(data: _Bytes, *, backtick: bool = ...) -> bytes: ...
else:
def b2a_uu(data: _Bytes) -> bytes: ...
def a2b_base64(string: _Ascii) -> bytes: ...
if sys.version_info >= (3, 6):
def b2a_base64(data: _Bytes, *, newline: bool = ...) -> bytes: ...
Expand Down
8 changes: 8 additions & 0 deletions stdlib/2and3/calendar.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ class HTMLCalendar(Calendar):
def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
def formatyear(self, theyear: int, width: int = ...) -> str: ...
def formatyearpage(self, theyear: int, width: int = ..., css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ...
if sys.version_info >= (3, 7):
cssclasses: List[str]
cssclass_today: str
cssclasses_weekday_head: List[str]
cssclass_month_head: str
cssclass_month: str
cssclass_year: str
cssclass_year_head: str

if sys.version_info < (3, 0):
class TimeEncoding:
Expand Down
2 changes: 2 additions & 0 deletions stdlib/2and3/contextlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if sys.version_info >= (3, 5):

if sys.version_info >= (3, 6):
from typing import ContextManager as AbstractContextManager
if sys.version_info >= (3, 7):
from typing import AsyncContextManager as AbstractAsyncContextManager

_T = TypeVar('_T')

Expand Down
7 changes: 6 additions & 1 deletion stdlib/2and3/crypt.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ if sys.version_info >= (3, 3):
METHOD_MD5: _Method
METHOD_SHA256: _Method
METHOD_SHA512: _Method
if sys.version_info >= (3, 7):
METHOD_BLOWFISH: _Method

methods: List[_Method]

def mksalt(method: Optional[_Method] = ...) -> str: ...
if sys.version_info >= (3, 7):
def mksalt(method: Optional[_Method] = ..., *, rounds: Optional[int] = ...) -> str: ...
else:
def mksalt(method: Optional[_Method] = ...) -> str: ...
def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ...
else:
def crypt(word: str, salt: str) -> str: ...
3 changes: 3 additions & 0 deletions stdlib/2and3/datetime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ class datetime:
else:
@classmethod
def combine(cls, date: date, time: time) -> datetime: ...
if sys.version_info >= (3, 7):
@classmethod
def fromisoformat(cls, date_string: str) -> datetime: ...
def strftime(self, fmt: _Text) -> str: ...
if sys.version_info >= (3,):
def __format__(self, fmt: str) -> str: ...
Expand Down