Commit Graph

8 Commits

Author SHA1 Message Date
Eric Traut
002a444dff Added missing type annotations for fractions and numbers modules. (#4401)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-15 18:28:14 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Ran Benita
c7417e8b3f builtins,numbers: harmonize float.__round__ and Real.__round__ (#3193)
See:
https://docs.python.org/3/reference/datamodel.html#object.__round__
https://docs.python.org/3/library/functions.html#round
2019-08-17 07:23:04 -07:00
Sebastian Rittau
cd75801aa5 Replace non-ellipsis default arguments (#2550) 2018-11-20 07:35:06 -08:00
Yusuke Miyazaki
86883d3df9 Remove unused import statements (#2282) 2018-06-27 20:14:57 -07:00
Jelle Zijlstra
54dd6ba27c Change numerous default values to ... (#1722)
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Elliot Marsden
2a115b1714 Indicate that float() accepts Real objects (#1434)
This contradicts CPython, in `Lib/numbers.py`, because `Real` does not
actually inherit from `SupportsFloat`. But it suppresses errors from
mypy when passing sub-classes like `fractions.Fraction` to `float()`.
2017-06-24 07:55:41 -07:00
Michael Lee
f29a996501 Refine stubs for numbers.pyi (#543)
* 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.
2016-09-14 08:12:36 -07:00