Commit Graph

8 Commits

Author SHA1 Message Date
Rune Tynan
7ac284f641 Add _pydecimal and _decimal stubs (#4003) 2020-05-27 10:10:51 +02:00
Shantanu
324d18b956 decimal: remove non-existent args from py3, mark positional-only args (#3633) 2020-01-23 15:00:48 +01:00
Sebastian Rittau
ec7960a8cb Convert namedtuples to class syntax (#3321) 2019-10-20 10:37:33 +02:00
Michael J. Sullivan
0350e9fa89 Fix some issues with __round__ (#2907)
In python 3, add an overload for there being no digits argument
and make it return int.

In python 2, __round__ doesn't exist and SupportsRound doesn't exist
in the typing module. Use SupportsFloat for python 2 round().

Remove decimal's __round__ overload that takes None, since it doesn't exist
2019-04-09 11:45:10 -07:00
Utkarsh Gupta
b3ced5b8c0 decimal.pyi: Add overload for Decimal.__round__() (#2674)
Fixes #2528
2018-12-07 10:00:24 +01:00
Rebecca Chen
9e72a7fd0c Fix the return type of decimal.Decimal.__new__. (#2458) 2018-09-15 18:12:52 +02:00
Sebastian Rittau
4b8c37462e Fix decimal (#2323)
* Use Tuple field in DecimalTuple

* Remove unnecessary base classes from Decimal

* Decimal.__init__ -> __new__

* Decimal.__ne__ is not defined in Python 3

* Add Decimal.as_integer_ratio()

* Annotate DecimalException.handle()

* Correct types of Decimal method arguments

* Add missing arguments and optional markers to Decimal

* Add missing arguments to Context

* Remove spurious int from Unions with float

* Remove Context.__setattr__()

* Fix return types of Context methods
2018-07-18 21:59:08 -07:00
Sebastian Rittau
a38dbc6c1e Merge decimal (#2306) 2018-07-09 19:03:01 -07:00