This commit adds some incomplete stubs for the fractions module. In
particular, this commit does not add type signatures for the more
complex functions (such as `__add__`), and just leaves their types as
effectively `Any`.
* 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.
* Partially refine numbers.pyi
This commit refines numbers.pyi. More specifically, it...
- Adds in explicit type annotations where it's obvious how to do
so (leaving more non-obvious type signatures alone).
- Adds in missing '@abstractmethod' decorators
- Combines together the Python 2 and Python 3 versions of numbers.pyi.
* Merges Python 2 and Python 3 numbers.pyi
This commit removes the old `stdlib/2.7/numbers.pyi` file and moves the
previously-committed `stdlib/3/numbers.pyi` to the shared `2and3`
directory.
* Modify comment at top of numbers.pyi
Since the stubs are no longer identical to what stubgen creates, the
comment should also probably be changed.
In Python, it's possible to use the `next` builtin method on file
objects produced by `open`. This change modifies `typing.IO` so this
usage will successfully typecheck.
As of Python 2.7, you can pass in multiple iterables into some set
methods like union, intersection, difference, and update. So, for
example, `new_set = a.union(b, c)`.