Jon Dufresne
02401c836f
Add type annotations for Python 3 html.entities ( #3161 )
2019-07-31 15:46:16 +02:00
Jon Dufresne
f2fdb54765
Precise the type of Python 2 htmlentitydefs module ( #3163 )
...
The code and documentation specifies the values specifically as
dictionaries.
2019-07-31 15:45:50 +02:00
Jon Dufresne
edee7cfb3c
Remove unused import from stdlib/2/htmlentitydefs.pyi ( #3162 )
2019-07-31 09:06:02 +02:00
Anthony Sottile
29dde6c883
Fix type annotations for get_wch / unget_wch ( #3157 )
2019-07-30 17:57:11 +02:00
Ville Skyttä
c6cbe4da66
inspect: use more specific arg type for some source retrieve functions ( #3155 )
2019-07-30 17:53:56 +02:00
Brad
bd2d0fcc85
Add hints for 3 globals from logging/__init__.py ( #3159 )
2019-07-30 17:28:13 +02:00
Anthony Sottile
32a89809f0
curses: getch returns an integer ( #3156 )
2019-07-30 09:25:01 +02:00
Michael R. Shannon
568f1ea555
Add attributes to xml.etree.ElementTree.ParseError. ( #3158 )
2019-07-30 08:48:28 +02:00
Sebastian Rittau
9ccf9356bf
Remove Python 3.4 support ( #3147 )
...
Closes #3123
2019-07-27 10:58:21 +02:00
Kamil Bar
4697adcb1a
[stdlib][3] Add missing typing.OrderedDict generic stub for Python 3.7.2 ( #3153 )
2019-07-26 20:46:15 +02:00
Ran Benita
c8e7d98c1f
Allow function.__code__ in Python 2 ( #3152 )
...
The following code works:
>>> print(sys.version)
2.7.16 (default, Mar 11 2019, 18:59:25)
>>> def f(): pass
>>> print(f.__code__)
<code object f at 0x7f8534ecc8a0, file "<stdin>", line 1>
>>> isinstance(f.__code__, types.CodeType)
True
but it didn't type-check with `mypy --python-version 2.7`.
2019-07-26 07:40:22 -07:00
Connor Brinton
df8ecf5a67
Fix incorrectly named parameters in logging module ( #3148 )
2019-07-25 21:29:55 +02:00
Vasily Zakharov
e9d1f86591
gettext stubs fixed ( #3130 )
2019-07-25 16:57:14 +02: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ä
8e0d288ea4
json: require a JSONDecoder/JSONEncoder in cls ( #3138 )
2019-07-23 22:59:57 +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
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
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
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
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