Skip to content

Commit 54ecefe

Browse files
JelleZijlstragvanrossum
authored andcommitted
removals in Python 3.7 (#2018)
Last part of #1965.
1 parent 0acdfd1 commit 54ecefe

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

stdlib/2and3/plistlib.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if sys.version_info < (3,):
4646
def readPlistFromString(data: str) -> DictT[str, Any]: ...
4747
def writePlistToString(rootObject: Mapping[str, Any]) -> str: ...
4848

49-
if sys.version_info >= (3,):
49+
if sys.version_info < (3, 7):
5050
class Dict(dict):
5151
def __getattr__(self, attr: str) -> Any: ...
5252
def __setattr__(self, attr: str, value: Any) -> None: ...

stdlib/2and3/tarfile.pyi

+5-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ class TarFile(Iterable[TarInfo]):
119119
path: _Path = ...) -> None: ...
120120
def extractfile(self,
121121
member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ...
122-
if sys.version_info >= (3,):
122+
if sys.version_info >= (3, 7):
123+
def add(self, name: str, arcname: Optional[str] = ...,
124+
recursive: bool = ..., *,
125+
filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ...
126+
elif sys.version_info >= (3,):
123127
def add(self, name: str, arcname: Optional[str] = ...,
124128
recursive: bool = ...,
125129
exclude: Optional[Callable[[str], bool]] = ..., *,

stdlib/3/collections/__init__.pyi

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ _VT = TypeVar('_VT')
5252

5353

5454
# namedtuple is special-cased in the type checker; the initializer is ignored.
55-
if sys.version_info >= (3, 6):
55+
if sys.version_info >= (3, 7):
56+
def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,
57+
rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ...
58+
elif sys.version_info >= (3, 6):
5659
def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,
5760
verbose: bool = ..., rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ...
5861
else:

stdlib/3/os/__init__.pyi

+5-4
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,11 @@ if sys.version_info >= (3, 3):
480480
follow_symlinks: bool = ...) -> stat_result: ...
481481
else:
482482
def stat(path: _PathType) -> stat_result: ...
483-
@overload
484-
def stat_float_times() -> bool: ...
485-
@overload
486-
def stat_float_times(__newvalue: bool) -> None: ...
483+
if sys.version_info < (3, 7):
484+
@overload
485+
def stat_float_times() -> bool: ...
486+
@overload
487+
def stat_float_times(__newvalue: bool) -> None: ...
487488
def statvfs(path: _FdOrPathType) -> statvfs_result: ... # Unix only
488489
if sys.version_info >= (3, 3):
489490
def symlink(source: _PathType, link_name: _PathType,

stdlib/3/posixpath.pyi

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Ron Murawski <[email protected]>
33

44
# based on http://docs.python.org/3.2/library/os.path.html
5-
5+
import sys
66
from typing import Any, List, Tuple, IO
77

88
# ----- os.path variables -----
@@ -43,4 +43,5 @@ def sameopenfile(fp1: IO[Any], fp2: IO[Any]) -> bool: ...
4343
def split(path: str) -> Tuple[str, str]: ...
4444
def splitdrive(path: str) -> Tuple[str, str]: ...
4545
def splitext(path: str) -> Tuple[str, str]: ...
46-
# def splitunc(path: str) -> Tuple[str, str] : ... # Windows only, deprecated
46+
if sys.version_info < (3, 7) and sys.platform == 'win32':
47+
def splitunc(path: str) -> Tuple[str, str]: ...

0 commit comments

Comments
 (0)