Sebastian Rittau
b20e5b6c14
Travis: run mypy with Python 3.8 as well ( #3146 )
...
This runs mypy both with Python 3.7 and 3.8. In Python 3.8,
mypy switched from using typed-ast to using Python's built-in ast.
This patch ensures that both are tested.
2019-07-25 07:43:52 -07:00
Maarten ter Huurne
32ee49c79c
Add zipfile.ZipFile.filename ( #3104 )
2019-07-25 11:26:39 +02:00
Ran Benita
c9f9530224
xml.etree.ElementTree: use literal type for a more precise return value for tostring() ( #3120 )
2019-07-25 09:31:12 +02:00
Michael J. Sullivan
b3f7be523a
Fix __call__ type for GeneratorContextManager ( #3143 )
2019-07-24 22:20:15 +02:00
Ville Skyttä
bf50612d76
inspect: get{doc,comments,module,sourcefile} can return None ( #3137 )
2019-07-24 22:05:01 +02:00
Ran Benita
9a7b286c66
warnings: ignore the type of category when message is a Warning ( #3121 )
2019-07-24 21:46:23 +02:00
Sebastian Rittau
0177dedc42
Add werkzeug.middleware ( #3103 )
...
HTTPConnection.timeout can be a float
2019-07-24 08:51:55 -07:00
Zsolt Dollenstein
8794e40d41
Fix ast.Constant availability ( #3142 )
2019-07-24 14:10:51 +02:00
Ville Skyttä
322be1b9e7
Upgrade flake8* and isort versions ( #3141 )
2019-07-23 23:02:19 +02:00
Ville Skyttä
8e0d288ea4
json: require a JSONDecoder/JSONEncoder in cls ( #3138 )
2019-07-23 22:59:57 +02:00
Nipunn Koorapati
67d091db15
Update google RepeatedCompositeFieldContainer ( #3136 )
2019-07-22 09:00:22 +02:00
Daniel Hahler
9dcdc7d481
faulthandler.dump_traceback_later: timeout can be float ( #3134 )
2019-07-21 01:04:25 +02:00
Naman
9379cedfa7
remove itertools.accumulate from Python 2 stubs ( #3135 )
2019-07-19 22:31:32 -07:00
Michael J. Sullivan
4072ad82fb
Fix python 2 subprocess.Popen to produce Popen[bytes] ( #3133 )
...
Otherwise this causes a lot of spurious errors.
2019-07-19 14:17:32 -07:00
Michael J. Sullivan
90c2c22961
Make python 2 subprocess consistent with python 3 ( #3132 )
2019-07-19 10:56:59 -07:00
Sebastian Rittau
dad16f2d43
Update socket exceptions ( #3127 )
...
* error is an alias for OSError in Python 3
* herror and gaierror can be constructed without arguments (tested
in Python 2.7 and 3.7)
* timeout uses the same arguments as herror and gaierror
2019-07-18 16:50:28 -07:00
Yannack
40215d1fa3
Fix the definition of nsmallest() in stdlib/2 and 2and3/heapq.pyi ( #3114 )
...
Missing support of the optional "key" kwarg in nsmallest.
Also fixed nlargest syntax for 2and3 which was also missing.
Use a protocol for heapq.py
2019-07-18 21:38:28 +02:00
Sebastian Rittau
09d1055cd3
Remove mypy new analyzer tests ( #3128 )
...
Now that the new analyzer is the default, this does exactly the same
as the normal mypy self test.
2019-07-18 17:02:12 +02:00
Ivan Levkivskyi
508f992730
Add __eq__ to protobuf containers ( #3126 )
...
See https://github.com/protocolbuffers/protobuf/blob/master/python/google/protobuf/internal/containers.py .
Without these `mypy --strict-equality` causes false positives with protobufs.
2019-07-17 23:25:22 +01:00
William Ayd
8e89faa90f
Added Optional ( #3125 )
...
Fixes #3124
2019-07-17 10:08:46 +02:00
Michael J. Sullivan
3ad3ed82c7
Overload the constructor of subprocess.Popen ( #3113 )
...
This takes advantage of a recent mypy change to respect the return
type of `__new__`. Using that it does the same tedious overloads
as `run` and `check_output`.
2019-07-16 15:41:33 -07:00
秋葉
e2ec5d0525
Make SyntaxError.text be optional ( #3119 )
...
Closes #3118
2019-07-15 09:11:45 +02:00
Anthony Sottile
f76b7b273b
Re-export _curses._CursesWindow from curses ( #3117 )
2019-07-13 08:01:10 -07:00
Anthony Sottile
2a57ce2cec
Add curses.COLORS and curses.COLOR_PAIRS ( #3115 )
2019-07-13 07:50:13 -07:00
Rebecca Chen
40124b5f4c
Update required pytype version to one that supports async def. ( #3112 )
2019-07-11 12:47:46 -07:00
Brandt Bucher
34b47101dd
Slice attributes can be of any type. ( #3024 )
2019-07-11 12:13:32 -07:00
Ran Benita
4ae4714e00
sys: refine the return type of sys.exc_info() ( #3111 )
2019-07-11 10:43:37 +02:00
Michael J. Sullivan
b43e1d674f
Use Literal overloads to give better types to subprocess ( #3110 )
...
This gives better types to `subprocess.check_output` and `subprocess.run`
by laboriously overloading using literals.
To support `run`, I turned `CompletedProcess` into `_CompletedProcess[T]`
with `CompletedProcess = _CompletedProcess[Any]`. I could pretty easily
be convinced that it would be better to just make `CompletedProcess`
generic, though.
I'd like to do the same for Popen but need to make mypy support
believing the type of `__new__` in order for that to work.
2019-07-10 14:44:27 -07:00
Cole Maclean
f5c107cacd
BytesGenerator requires BinaryIO ( #3106 )
2019-07-07 22:03:07 -07:00
Sebastian Rittau
1436cfdef9
Add types to FileStorage ( #3067 )
2019-07-04 12:58:51 -07:00
Savo Kovačević
84e6492d7e
Improving Flask stubs ( #3003 )
...
* Fix flask render_template and render_template_string stubs
* Add types for flask view function
* Import TracebackType from the right location
* Switch to bound typevar in route decorator stub
* Change render_template and render_template_string parameters to Text
2019-07-04 12:57:06 -07:00
Sam Zhou
4af283e1ac
Fix HTTPConnection.putrequest parameter names ( #3101 )
2019-07-03 08:52:59 +02:00
ikelos
3e700224ba
Add in multiprocessing.managers.ValueProxy types ( #3100 )
...
Fixes #1778
2019-07-03 08:49:16 +02:00
Francis Colas
75d9228b02
PurePath methods accept os.PathLike[str] from 3.6 ( #3099 )
...
Closes #3095
2019-07-02 13:08:32 +02:00
Rafi Blecher
668d050476
Fix contextlib GeneratorContextManager name for py>=3.2 ( #3083 )
2019-07-02 10:56:40 +01:00
Martijn Pieters
e1e5c83795
QueueHandler / QueueListener accept SimpleQueue too ( #3098 )
...
The implementation of `logging.adapters.QueueHandler` and `logging.adapters.QueueListener` works great with `queue.SimpleQueue` too, so update the stub to reflect this.
The new queue.SimpleQueue class (introduced in 3.7) is faster but is not a Queue subclass as it doesn't implement task handling (`handle_task()` / `join()`) or queue bounds (raising `queue.Full` / `full()`). The logging handler / listener implementations do not make use of those features however.
Related Python bug, asking for an explicit documentation mention: https://bugs.python.org/issue37469
2019-07-01 07:47:30 -07:00
Ran Benita
c66699800e
xml.etree.ElementTree: fix missing None in get(), findtext() return type ( #3093 )
2019-07-01 14:28:40 +02:00
Jason Gilholme
8b66e08745
Add Generic Typing to Queue.PriorityQueue and Queue.LifoQueue in python 2 ( #3036 )
2019-07-01 14:05:13 +02:00
Hynek Schlawack
47450629c9
Add TLSVersion & related attributes to SSLContext ( #3097 )
2019-07-01 14:03:57 +02:00
Benjamin Woodruff
3272307933
Make dataclasses.Field.metadata non-optional ( #3094 )
...
If `metadata` is `None` the Field constructor replaces it with an empty
mapping object, so this value can never be None.
https://github.com/python/cpython/blob/v3.7.3/Lib/dataclasses.py#L243
2019-06-28 18:28:50 -07:00
Rebecca Chen
5dc89fe8cf
Add undocumented methods codecs.utf_16_be_{decode,encode}. ( #3091 )
...
I found the signatures here:
6a16b18224/Modules/_codecsmodule.c (L729)
https://github.com/google/pytype/issues/348 was opened against
pytype about utf_16_be_encode being missing.
2019-06-26 20:29:16 -07:00
Gordon Ball
7e9e91cb7b
Restore default value to click.echo_via_pager ( #3090 )
2019-06-26 13:21:05 -07:00
Eric Arellano
8131bfc3f6
Install Black and isort autoformatters ( #3069 )
...
* Install Black and isort
* Add config via pyproject.toml
Notably we keep the convention of 130 line length.
* Add target python version
2019-06-24 08:44:20 +02:00
redshiftzero
64b12bf7f1
itsdangerous: update JSONWebSignatureSerializer.dumps return type ( #3082 )
...
On Python 2, a str is returned, however on Python 3 the return type
is bytes.
2019-06-22 14:15:37 -07:00
Chad Dombrova
e25c0cb128
"key" argument of builtin function sorted should be optional in python 2.7 ( #3086 )
2019-06-22 14:09:51 -07:00
Maarten ter Huurne
bdd49d0f3a
Fix annotation of re.Match 'lastindex' and 'lastgroup' in Python 3 ( #3085 )
...
Both are None if there were no groups matched. Also 'lastgroup'
will be None if the matched group was nameless.
The Python 2 versions of these annotations already used Optional.
2019-06-22 10:18:16 -07:00
Jelle Zijlstra
b0c9fa4530
fix type of loop.sock_connect ( #3073 )
2019-06-21 17:31:51 +02:00
Jelle Zijlstra
ada0570efc
Revert "Define functools.partial as overloaded function instead of its own class ( #2878 )" ( #3077 )
...
This reverts commit e45f443d85 .
2019-06-20 20:39:49 -07:00
crusaderky
9941616b9e
Add mp_context parameter to concurrent.futures.ProcessPoolExecutor ( #3078 )
...
Closes #3076
2019-06-20 19:42:26 +02:00
秋葉
2b6a99c39c
fix ssl.Purpose type in py3 ( #3054 )
2019-06-20 19:41:32 +02:00