Python3.8 additions and changes (#3337)

* Add as_integer_ratio() to a few types

* Add dirs_exist_ok to copytree()

* int, float, complex accept __index__ args

Also fix complex.__init__ argument names

* Add __reversed__ to dict et al.

* Python 3.8 date(time) arithmetic fixes

* Add CodeType.replace()
This commit is contained in:
Sebastian Rittau
2019-10-11 05:51:27 +02:00
committed by Jelle Zijlstra
parent d0beab9b8e
commit 8a7d61741d
7 changed files with 97 additions and 27 deletions

View File

@@ -72,7 +72,17 @@ else:
def ignore_patterns(*patterns: _Path) -> Callable[[Any, List[_AnyStr]], Set[_AnyStr]]: ...
if sys.version_info >= (3,):
if sys.version_info >= (3, 8):
def copytree(
src: _Path,
dst: _Path,
symlinks: bool = ...,
ignore: Union[None, Callable[[str, List[str]], Iterable[str]], Callable[[_Path, List[str]], Iterable[str]]] = ...,
copy_function: Callable[[str, str], None] = ...,
ignore_dangling_symlinks: bool = ...,
dirs_exist_ok: bool = ...,
) -> _PathReturn: ...
elif sys.version_info >= (3,):
def copytree(src: _Path, dst: _Path, symlinks: bool = ...,
ignore: Union[None,
Callable[[str, List[str]], Iterable[str]],