Alex Vandiver and Jelle Zijlstra
5505cb83bb
Add generated stubs for google.protobuf, from its protobufs ( #2095 )
...
This fleshes out the auto-generated pieces of `google.protobuf`, by
using the go version of https://github.com/dropbox/mypy-protobuf to
generate mypy stubs from the .proto files in
https://github.com/google/protobuf/tree/master/src/google/protobuf
Generated from current `master` of google/protobuf, 25625b956a.
Ref google/protobuf#3803 , python/typeshed#1705
2018-05-15 10:11:01 -04:00
Jelle Zijlstra and Guido van Rossum
463b4144dc
explicitly import boto.regioninfo ( #2121 )
...
This may be causing intermittent test failures (see discussion on gitter).
2018-05-15 10:09:44 -04:00
Katelyn Gigante and Jelle Zijlstra
51446f35fc
Add stub for dateutil.rrule ( #1808 )
2018-05-15 09:04:57 -04:00
Stanislav Syekirin and Jelle Zijlstra
4e1cc807aa
adding a stub for tkinter.messagebox ( #2113 )
2018-05-13 08:36:11 -04:00
Daniel Li and Jelle Zijlstra
56a31be7a7
Add stubs for submodules of six.moves ( #2108 )
...
To support "from six.moves.cPickle import loads", we must add a stub for
six.moves.cPickle as if it were a real submodule, even though it isn't
implemented as such. This fixes python/mypy#1550 .
We don't apply this approach to six.moves.builtins on Python 2, because
it seems to confuse mypy.
We also add stubs for aliases in six.moves whose underlying modules have
been added to typeshed.
For Python 2:
- six.moves.SimpleHTTPServer (alias for SimpleHTTPServer)
For Python 3:
- six.moves.tkinter_dialog (alias for tkinter.dialog)
- six.moves.tkinter_filedialog (alias for tkinter.filedialog)
- six.moves.tkinter_commondialog (alias for tkinter.commondialog)
- six.moves.tkinter_tkfiledialog (alias for tkinter.filedialog)
2018-05-12 12:02:44 -04:00
Phillip Schanely and Jelle Zijlstra
86f9472bc9
Correct 2 typing comments in inspect module ( #2110 )
2018-05-12 01:27:29 -04:00
Omar Sandoval and Jelle Zijlstra
0a30d22f0d
Fix Python 3 round() signature ( #2107 )
...
In Python 3, the ndigits argument of round() defaults to None. If
ndigits is excluded or explicitly None, the result is always an int. If
ndigits is not None, the result should be the same type as the number.
$ cat test.py
from fractions import Fraction
print(type(round(0.1)))
print(type(round(0.1, None)))
print(type(round(0.1, 0)))
print(type(round(Fraction(1, 10))))
print(type(round(Fraction(1, 10), None)))
print(type(round(Fraction(1, 10), 0)))
$ python3 ./test.py
<class 'int'>
<class 'int'>
<class 'float'>
<class 'int'>
<class 'int'>
<class 'fractions.Fraction'>
Update the signatures to allow for an ndigits of None.
2018-05-11 14:02:09 -04:00
Omar Sandoval and Jelle Zijlstra
aab1b20c80
Add missing namespace argument to rlcompleter.Completer ( #2105 )
...
This argument has been around since 2.3, and it's documented in the
rlcompleter docstring (although not on python.org).
2018-05-09 22:12:02 -07:00
Salvo 'LtWorf' Tomaselli and Jelle Zijlstra
d289c20260
Add __new__ to tuple stub ( #2092 )
...
Closes : #2091
Apply suggestions from https://github.com/python/typeshed/pull/2092
2018-05-09 16:30:58 -07:00
Jasper Spaans and Jelle Zijlstra
2df4a32cf5
Let email.message.MIMEPart inherit from Message ( #2103 )
...
Also removes some duplication.
2018-05-09 16:28:14 -07:00
Sebastian Rittau and Jelle Zijlstra
09008599ce
Merge Python 2 and 3 wsgiref ( #2106 )
...
* Merge Python 2 and 3 wsgiref
* Move wsigref to 2and3
2018-05-09 16:26:03 -07:00
Dominik Gabi and Jelle Zijlstra
3f196bde44
Make NamedTuple._replace return instance of the self parameter. ( #2102 )
2018-05-09 16:24:23 -07:00
Danny Weinberg and Jelle Zijlstra
9b479fd07e
Have Python 2 IntEnum values be ints ( #2104 )
...
Currently the Python 2 stub for `IntEnum` just inherits from `Enum` without changing anything, meaning that its `value` has type `Any`. This changes it such that, if you know you have an `IntEnum` you get the more specific `int` type for the `value`. Note that this has already been done for Python 3 `IntEnum` (both in `third_party/3/enum.pyi` and `stdlib/3.4/enum.pyi`).
2018-05-08 19:39:45 -07:00
Guido van Rossum and GitHub
d854d7e2a0
Revert "Fix signature of generic_visit method ( #2100 )" ( #2101 )
...
This reverts commit 39576c5d41 .
I merged too soon -- tests are failing.
2018-05-07 11:21:19 -07:00
Thomas Schaper and Guido van Rossum
39576c5d41
Fix signature of generic_visit method ( #2100 )
...
This methods returns something that has the same type as the first argument.
Fixes #2085 .
2018-05-07 11:20:20 -07:00
Andrew Svetlov and Jelle Zijlstra
252d79981b
Add a stub for sys.implementation ( #2097 )
2018-05-06 08:40:56 -07:00
Andrew Svetlov and Ivan Levkivskyi
142c7488a5
Implement a stub for netrc standard module ( #2098 )
2018-05-06 10:25:40 +01:00
Andrew Gaul and Jelle Zijlstra
29bf24b8b9
Reparent simplejson from 2 to 2and3 ( #2088 )
2018-05-04 15:59:26 -07:00
David Euresti and Jelle Zijlstra
863b9b0886
Add new factory arg to attrib and fields_dict ( #2096 )
2018-05-04 07:53:52 -07:00
Emil Hessman and Jelle Zijlstra
4d8010a988
Define threading.local as a proper class ( #2086 )
...
Fixes #1591
2018-04-30 08:48:12 -07:00
Emil Hessman and Jelle Zijlstra
97e261cce8
Define SimpleNamespace as a proper class ( #2087 )
2018-04-29 23:02:13 -07:00
Jelle Zijlstra and Matthias Kramm
fc9a822348
specify what type Binary is ( #2057 )
...
Fixes python/mypy#4916 .
2018-04-27 14:40:33 -07:00
Jelle Zijlstra and Matthias Kramm
46f0bb8b91
support unicode in Python 2 for difflib ( #2055 )
...
Fixes #1961 .
I mostly just replaced all str annotations with Text, including in return types. This is
only broadly correct; diffing a str and a unicode sequence actually results in a mixed
output of str and unicode. We could also keep the return types as str if using Text
causes errors in real code. For callbacks that take str, I introduced a Union alias
because a callable taking a str would not be a compatible with a parameter of type
Callable[[Text], bool].
I also fixed the return type of difflib.restore.
2018-04-27 14:39:18 -07:00
Jelle Zijlstra and Matthias Kramm
f60ffe47a2
add attributes to locale ( #2056 )
...
Fixes #1888 .
2018-04-27 14:38:22 -07:00
Jelle Zijlstra and Matthias Kramm
c7e3e9890d
add UserDict.__init__ for Python 3 ( #2083 )
...
Fixes #2075
2018-04-27 14:38:00 -07:00
Jelle Zijlstra and Matthias Kramm
9e25506cab
add missing attributes to Python 2 unicode errors ( #2084 )
2018-04-27 14:37:20 -07:00
Jelle Zijlstra and Guido van Rossum
5554b0b19b
argparse.ArgumentParser.error never returns ( #2082 )
...
And neither does `.exit`.
Fixes #2081 .
2018-04-25 21:30:31 -07:00
Zabolekar and Jelle Zijlstra
5ddff9c44a
Add a stub for tkinter.filedialog and for the modules it imports ( #2058 )
2018-04-25 19:44:42 -07:00
Martijn Pieters and Jelle Zijlstra
ecae01a37d
collections.OrderedDict dict views are reversible ( #2079 )
...
Add the *View subclasses for OrderedDict use, with appropriate __reversed__
hints.
Fixes python/typeshed#2078
2018-04-25 19:44:25 -07:00
David Euresti and Jelle Zijlstra
664d30c44b
Fix attr.Factory signature ( #2077 )
...
The first overload was catching all calls including take_self=True.
Fix it by modifying the overloads.
Fixes https://github.com/python-attrs/attrs/issues/366
2018-04-23 12:27:14 -07:00
Guido van Rossum and Jelle Zijlstra
2dc7d39af5
Add 'file=...' to FieldDescriptor constructor. ( #2073 )
2018-04-20 14:51:19 -07:00
Charles-Axel Dein and Jelle Zijlstra
5818893a7f
Add default_exceptions to werkzeug.exceptions ( #2071 )
2018-04-19 09:03:24 -07:00
Tomas Krizek and Jelle Zijlstra
db5137b756
stdlib/selectors: change timeout argument type to float ( #2070 )
...
The Selector's code internally uses select.select and passes the
timeout argument to it. The documentation explicitly states the
timeout is a floating point number:
https://docs.python.org/3/library/select.html?highlight=select#select.select
2018-04-19 08:36:53 -07:00
Martin DeMello and Jelle Zijlstra
2935017157
Add multiprocessing.dummy pyi files ( #2059 )
2018-04-18 19:20:01 -07:00
Aaron Miller and Jelle Zijlstra
8e62a79970
Fix type of click.Path path_type arg ( #2066 )
...
path_type takes a *type*, rather than instance of the type
2018-04-17 23:32:02 -07:00
Semyon Proshev and Jelle Zijlstra
5223b26ec8
Add __round__ to int and float in Python 3 ( #2061 )
2018-04-17 14:25:04 -07:00
Freek Dijkstra and Jelle Zijlstra
55a3bad0f8
fix signature for difflib.get_close_matches ( #2064 )
...
Fixes #2063 .
The second argument to difflib.get_close_matches not only accepts a List, but any Iterator.
2018-04-17 14:24:27 -07:00
Martin DeMello and Jelle Zijlstra
aeb1aa4899
add requirements.txt to travis config ( #2062 )
2018-04-17 14:15:58 -07:00
Jelle Zijlstra and Guido van Rossum
a5429d25dc
add missing methods to DictMixin ( #2054 )
...
Fixes #1896 .
2018-04-14 14:21:07 -07:00
Siva Chandra and Jelle Zijlstra
035774e022
Adjust return types of shed.scheduler.run. ( #2050 )
2018-04-13 21:00:27 -07:00
Michael J. Sullivan and Jelle Zijlstra
d63866bd36
Fix py2 unicode handling for ArgumentParser.add_argument's text arg ( #2051 )
...
add_argument's type argument was recently changed to be (approximately)
`Callable[[_Text], _T]`. Because of contravariant subtyping for functions,
this had the effect of requiring that add_argument *always*
be unicode, which is wrong.
Change it to be `Callable[[str], _T]`.
2018-04-12 20:45:48 -07:00
Jelle Zijlstra and Łukasz Langa
b1a0b8ad6e
add subprocess.STARTUPINFO and some associated constants ( #2041 )
2018-04-12 12:29:42 -07:00
Jelle Zijlstra and Łukasz Langa
0f425db197
fix types for unittest.TestLoader.loadTestsFrom* methods ( #2042 )
...
Fixes #2008 .
2018-04-12 12:29:32 -07:00
Jelle Zijlstra and Łukasz Langa
37aba00fe8
fix using ZipFile as a ContextManager ( #2043 )
2018-04-12 12:29:22 -07:00
Jelle Zijlstra and Łukasz Langa
b8b78886e3
add some Optionals to traceback.pyi ( #2044 )
...
Fixes #1974
2018-04-12 12:29:07 -07:00
Jelle Zijlstra and Łukasz Langa
840f34147e
add a lot more distutils.errors ( #2045 )
...
Fixes #1963 .
See https://github.com/python/cpython/blob/2.7/Lib/distutils/errors.py and https://github.com/python/cpython/blob/3.7/Lib/distutils/errors.py .
2018-04-12 12:28:55 -07:00
Eddie Schoute and Jelle Zijlstra
5327841a18
Add pathlib.Path.__enter__ and __exit__ ( #2048 )
2018-04-12 10:39:19 -07:00
Jelle Zijlstra and Guido van Rossum
7cd2016931
add sys.base_exec_prefix and sys.base_prefix ( #2047 )
...
See https://docs.python.org/3/library/sys.html#sys.base_exec_prefix .
Required for https://github.com/python/mypy/pull/4888
2018-04-11 13:59:44 -07:00
Chris Gavin and Jelle Zijlstra
dca53fb2bd
Make the help argument of argparse.add_argument Optional. ( #2046 )
2018-04-11 07:20:16 -07:00
Jelle Zijlstra and GitHub
db989427cb
dest argument to add_argument is Optional ( #2040 )
...
argparse.py checks for None in _get_optional_kwargs.
2018-04-10 21:47:30 -07:00