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

@@ -4,7 +4,7 @@
# Note: these stubs are incomplete. The more complex type
# signatures are currently omitted. Also see numbers.pyi.
from typing import Optional, TypeVar, Union, overload, Any
from typing import Optional, TypeVar, Union, overload, Any, Tuple
from numbers import Real, Integral, Rational
from decimal import Decimal
import sys
@@ -42,6 +42,8 @@ class Fraction(Rational):
def from_decimal(cls, dec: Decimal) -> Fraction: ...
def limit_denominator(self, max_denominator: int = ...) -> Fraction: ...
if sys.version_info >= (3, 8):
def as_integer_ratio(self) -> Tuple[int, int]: ...
@property
def numerator(self) -> int: ...
@property