Skip to content

another batch of 3.7 features #2015

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
Apr 6, 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
7 changes: 7 additions & 0 deletions stdlib/2and3/time.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ daylight: int
timezone: int
tzname: Tuple[str, str]

if sys.version_info >= (3, 7) and sys.platform != 'win32':
CLOCK_BOOTTIME: int # Linux
CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD
CLOCK_UPTIME: int # FreeBSD, OpenBSD

if sys.version_info >= (3, 3) and sys.platform != 'win32':
CLOCK_HIGHRES: int = ... # Solaris only
CLOCK_MONOTONIC: int = ... # Unix only
Expand Down Expand Up @@ -94,3 +99,5 @@ if sys.version_info >= (3, 7):
def perf_counter_ns() -> int: ...
def process_time_ns() -> int: ...
def time_ns() -> int: ...
def thread_time() -> float: ...
def thread_time_ns() -> int: ...
7 changes: 5 additions & 2 deletions stdlib/2and3/uu.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Stubs for uu (Python 2 and 3)

import sys
from typing import BinaryIO, Union, Optional, Text

_File = Union[Text, BinaryIO]

class Error(Exception): ...

def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ...) -> None: ...
if sys.version_info >= (3, 7):
def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ..., backtick: bool = ...) -> None: ...
else:
def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ...) -> None: ...
def decode(in_file: _File, out_file: Optional[_File] = ..., mode: Optional[int] = ..., quiet: int = ...) -> None: ...
9 changes: 7 additions & 2 deletions stdlib/3.5/zipapp.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Stubs for zipapp (Python 3.5+)

from pathlib import Path
from typing import BinaryIO, Optional, Union
import sys
from typing import BinaryIO, Callable, Optional, Union

_Path = Union[str, Path, BinaryIO]

class ZipAppError(Exception): ...

def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ...
if sys.version_info >= (3, 7):
def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...,
filter: Optional[Callable[[Path], bool]] = ..., compressed: bool = ...) -> None: ...
else:
def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ...
def get_interpreter(archive: _Path) -> str: ...
2 changes: 2 additions & 0 deletions stdlib/3/sys.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class _flags:
bytes_warning = 0
quiet = 0
hash_randomization = 0
if sys.version_info >= (3, 7):
dev_mode: int

float_info = ... # type: _float_info
class _float_info:
Expand Down
6 changes: 6 additions & 0 deletions stdlib/3/tkinter/ttk.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from typing import Any
import tkinter

Expand Down Expand Up @@ -105,6 +106,11 @@ class Separator(Widget):
class Sizegrip(Widget):
def __init__(self, master=None, **kw): ...

if sys.version_info >= (3, 7):
class Spinbox(Entry):
def __init__(self, master: Any = ..., **kw: Any) -> None: ...
def set(self, value: Any) -> None: ...

class Treeview(Widget, tkinter.XView, tkinter.YView):
def __init__(self, master=None, **kw): ...
def bbox(self, item, column=None): ...
Expand Down
3 changes: 3 additions & 0 deletions stdlib/3/unittest/mock.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,6 @@ if sys.version_info >= (3, 3):
class PropertyMock(Mock):
def __get__(self, obj: Any, obj_type: Any) -> Any: ...
def __set__(self, obj: Any, val: Any) -> Any: ...

if sys.version_info >= (3, 7):
def seal(mock: Any) -> None: ...