Commit Graph

14 Commits

Author SHA1 Message Date
Brandt Bucher
4230e6f313 Fix quit's argument and return types to match those of exit. (#2915)
Fixes #2912.
2019-04-12 16:57:26 +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
Chen Li
598d0d6ae1 [builtins] Add 'AST' type to 'source' parameter for 'compile()' (#2889) 2019-03-27 08:29:16 +01:00
Michael J. Sullivan
c526975a1b Add overloads for min/max that don't take default (#2885)
PR #2833 introduced more flexible handling for the type of the default
parameter, but the extra type variable caused some issues. Add another
overload for the case where there is no default param.

This is I think related to the issues we have had with `get` recently?
2019-03-25 15:38:21 -07:00
wouter bolsterlee
afe665690c Add missing BaseException.__suppress_context__ attribute (#2876)
See also PEP 415: https://www.python.org/dev/peps/pep-0415/

Fixes #2875.
2019-03-16 22:16:01 +01:00
Sebastian Rittau
26fefcc704 Use protocol for print() file argument (#2848)
Also, use object instead of Any for values list
2019-03-12 19:26:32 -07:00
Brandt Bucher
ab4c262043 Add isascii methods to str, bytes, and bytearray [Python 3.7]. (#2834) 2019-03-08 11:07:28 -08:00
herr kaste
4dcd516caa Improve min/max (#2833)
* For min/max return Union type if default given
* For min/max mark keyword only arguments
* Also mark positional arguments
2019-03-08 19:25:34 +01:00
Aymeric Augustin
f0c5ac04b0 Support *contiguous attributes of memoryview. (#2755) 2019-02-09 16:05:00 +01:00
Michael J. Sullivan
d8faf503ec Make SyntaxError.offset be optional (again) (#2782)
This was originally done in #2557, but got lost in #2533.
2019-02-08 11:09:18 -08:00
Utkarsh Gupta
ad803e1caa builtins.pyi: Update __iadd__() and imul() in class list (#2754)
Fixes #2711
2019-01-21 21:57:15 +01:00
Jelle Zijlstra
78690405cf add back StopIteration.value in Python 3 (#2744)
Fixes python/mypy#6209.
2019-01-16 19:21:16 -08:00
Michael J. Sullivan
c75d42ef23 Fix the type of ord on python 2 (#2735)
It looks like it got messed up in #2533
2019-01-10 19:24:51 -06:00
Sebastian Rittau
eb1788ac39 Merge Python 2 and 3 builtins.pyi (#2533) 2018-12-21 07:12:41 -08:00