Fix decimal and contextlib (#428)

* Decimal does not support __round__, and its __abs__ returns Decimal.

* Fix contextmanager signature too.
This commit is contained in:
Guido van Rossum
2016-08-02 07:39:13 -07:00
committed by Matthias Kramm
parent fd66ff21ae
commit 6e596e9609
2 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, SupportsAbs, SupportsFloat, SupportsInt, SupportsRound
from typing import Any, SupportsAbs, SupportsFloat, SupportsInt
ROUND_DOWN = ... # type: Any
ROUND_HALF_UP = ... # type: Any
@@ -44,7 +44,7 @@ def setcontext(context): ...
def getcontext(): ...
def localcontext(ctx=None): ...
class Decimal(SupportsAbs, SupportsFloat, SupportsInt, SupportsRound):
class Decimal(SupportsAbs[Decimal], SupportsFloat, SupportsInt):
def __new__(cls, value=..., context=None): ...
@classmethod
def from_float(cls, f): ...