removals in Python 3.7 (#2018)

Last part of #1965.
This commit is contained in:
Jelle Zijlstra
2018-04-06 11:11:29 -07:00
committed by Guido van Rossum
parent 0acdfd1548
commit 54ecefef04
5 changed files with 18 additions and 9 deletions

View File

@@ -46,7 +46,7 @@ if sys.version_info < (3,):
def readPlistFromString(data: str) -> DictT[str, Any]: ...
def writePlistToString(rootObject: Mapping[str, Any]) -> str: ...
if sys.version_info >= (3,):
if sys.version_info < (3, 7):
class Dict(dict):
def __getattr__(self, attr: str) -> Any: ...
def __setattr__(self, attr: str, value: Any) -> None: ...

View File

@@ -119,7 +119,11 @@ class TarFile(Iterable[TarInfo]):
path: _Path = ...) -> None: ...
def extractfile(self,
member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ...
if sys.version_info >= (3,):
if sys.version_info >= (3, 7):
def add(self, name: str, arcname: Optional[str] = ...,
recursive: bool = ..., *,
filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ...
elif sys.version_info >= (3,):
def add(self, name: str, arcname: Optional[str] = ...,
recursive: bool = ...,
exclude: Optional[Callable[[str], bool]] = ..., *,

View File

@@ -52,7 +52,10 @@ _VT = TypeVar('_VT')
# namedtuple is special-cased in the type checker; the initializer is ignored.
if sys.version_info >= (3, 6):
if sys.version_info >= (3, 7):
def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,
rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ...
elif sys.version_info >= (3, 6):
def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,
verbose: bool = ..., rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ...
else:

View File

@@ -480,10 +480,11 @@ if sys.version_info >= (3, 3):
follow_symlinks: bool = ...) -> stat_result: ...
else:
def stat(path: _PathType) -> stat_result: ...
@overload
def stat_float_times() -> bool: ...
@overload
def stat_float_times(__newvalue: bool) -> None: ...
if sys.version_info < (3, 7):
@overload
def stat_float_times() -> bool: ...
@overload
def stat_float_times(__newvalue: bool) -> None: ...
def statvfs(path: _FdOrPathType) -> statvfs_result: ... # Unix only
if sys.version_info >= (3, 3):
def symlink(source: _PathType, link_name: _PathType,

View File

@@ -2,7 +2,7 @@
# Ron Murawski <ron@horizonchess.com>
# based on http://docs.python.org/3.2/library/os.path.html
import sys
from typing import Any, List, Tuple, IO
# ----- os.path variables -----
@@ -43,4 +43,5 @@ def sameopenfile(fp1: IO[Any], fp2: IO[Any]) -> bool: ...
def split(path: str) -> Tuple[str, str]: ...
def splitdrive(path: str) -> Tuple[str, str]: ...
def splitext(path: str) -> Tuple[str, str]: ...
# def splitunc(path: str) -> Tuple[str, str] : ... # Windows only, deprecated
if sys.version_info < (3, 7) and sys.platform == 'win32':
def splitunc(path: str) -> Tuple[str, str]: ...