Thanks to visit codestin.com
Credit goes to github.com

Skip to content

removals in Python 3.7 #2018

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
2 changes: 1 addition & 1 deletion stdlib/2and3/plistlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that this class does exist in 2.7.

class Dict(dict):
def __getattr__(self, attr: str) -> Any: ...
def __setattr__(self, attr: str, value: Any) -> None: ...
Expand Down
6 changes: 5 additions & 1 deletion stdlib/2and3/tarfile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]] = ..., *,
Expand Down
5 changes: 4 additions & 1 deletion stdlib/3/collections/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions stdlib/3/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,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,
Expand Down
5 changes: 3 additions & 2 deletions stdlib/3/posixpath.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Ron Murawski <[email protected]>

# based on http://docs.python.org/3.2/library/os.path.html

import sys
from typing import Any, List, Tuple, IO

# ----- os.path variables -----
Expand Down Expand Up @@ -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]: ...