Commit Graph

6 Commits

Author SHA1 Message Date
Michael Lee
748428d8a4 Refine stubs for Python 2's decimal module (#545)
* Refine stubs for Python 2's decimal module

The decimal module for Python 2 was relatively incomplete, unlike the
decimal module for Python 3. This commit copies the relevant type
signatures from Python 3's decimal module to Python 2's.

There was a lot of code in both stubs and it wasn't clear to me if it
was safe to merge the two modules together, so I refrained from doing
so.

* Allow comparisions with Decimals and Floats

This commit loosens the types for Decimals to allow comparisons like
`Decimal('3.14') < 4.2`. Previously, you could compare decimals with
only other decimals or ints.
2016-09-14 09:40:14 -07:00
Guido van Rossum
6e596e9609 Fix decimal and contextlib (#428)
* Decimal does not support __round__, and its __abs__ returns Decimal.

* Fix contextmanager signature too.
2016-08-02 07:39:13 -07:00
Guido van Rossum
781b079f91 Add Supports{Abs,Float,Int,Round} as base classes for Decimal. (#415) 2016-07-28 15:13:27 -07:00
Alvaro Caceres
6701a10e93 Add 2.7/decimal.pyi generated by stubgen (#414)
* add decimaly.pyi

generated with
 stubgen --py2 decimal

* Strip out private stuff

* pytype compatibility

* fixes
2016-07-28 11:09:48 -07:00
Guido van Rossum
6a496215e7 Revert "Merge pull request #95 from youtux/feature/decimal-2.7"
This broke our build.

This reverts commit 0a496917e3, reversing
changes made to c8630a238d.
2016-03-08 10:38:45 -08:00
Alessio Bogon
00779c9564 stub for decimal, 2.7 only 2016-02-26 20:49:50 +01:00