Stephen Thorne
97240083c4
Correct the type signature of assertRaisesRegexp ( #2926 )
...
assertRaisesRegexp is the old name of assertRaisesRegex, they are the
same, just that the old one is deprecated.
2019-04-18 20:31:00 -07:00
Yegor Roganov
4cd9a8ef91
Make loop optional in asyncio.Queue ( #2923 )
...
Default value is `None`, so `loop` should be optional.
2019-04-14 12:43:33 -07:00
Philipp Schrader
d9c5422ebf
Add stub for multiprocessing.Value.get_lock() ( #2920 )
...
I also noticed that the "lock" parameter for Value's __init__ was
incomplete. The parameter also accepts lock objects directly.
https://docs.python.org/3.7/library/multiprocessing.html#multiprocessing.Value
Fixes #2917
2019-04-13 11:35:52 -07:00
Michael Lee
efb67946f8
Use variable annotations everywhere ( #2909 )
2019-04-13 10:40:52 +02:00
秋葉
b3c76aab49
KeysView and ItemsView should accecpt Iterable argument in set operation ( #2906 )
2019-04-12 23:05:58 -07:00
Michael J. Sullivan
f06f2e97bb
Make os.altsep Optional on non-win32 platforms ( #2918 )
...
Keep it str on win32 to avoid breaking win32-specific code that relies
on it.
2019-04-12 23:00:19 -07:00
Sebastian Rittau
bd10d8aad4
Add @typing.type_check_only ( #2679 )
...
Cf. python/typing#597
2019-04-12 15:32:22 -07:00
Masashi SHIBATA
c85fed8d98
Fix TextTestResult and TextTestRunner in unittest ( #2910 )
...
Co-Authored-By: c-bata <c-bata@users.noreply.github.com >
2019-04-12 12:50:12 +02:00
Sergey Machulskis
bec2fef7fa
threading.Lock issue when using it with ExitStack ( #2908 )
...
* Make threading primitives ContextManagers
* Make catch_warnings ContextManager
* Make SMTP ContextManager
* Fix type of exc_type for SMTP
2019-04-11 21:39:17 +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
Rebecca Chen
50a661afed
Complete the stub for _thread.pyi. ( #2900 )
...
Definitions based on https://docs.python.org/3/library/_thread.html .
2019-04-09 20:02:04 +02:00
Rune Tynan
cb7de8adfa
Fix typo in FrameType 3.7 attributes ( #2899 )
2019-04-03 22:52:34 +01:00
Rebecca Chen
9b9ff64fc5
tempfile.mkdtemp() should return a str when passed no arguments. ( #2893 )
...
Otherwise, pytype expands `AnyStr` to `Union[str, bytes]`, leading
to spurious type errors later on.
* Mark the `dir` argument to mkdtemp as AnyStr.
2019-03-29 23:11:42 +01:00
William Ayd
bce70d1ca6
Added excepthandler to ast stubfiles ( #2891 )
2019-03-28 08:23:56 -07:00
Michael J. Sullivan
cc596aefbc
Add a type: ignore as a hacky workaround for some mypy bazel issues ( #2887 )
2019-03-27 15:10:47 -07:00
Chen Li
094974c3f5
[re] Add attribute '_pattern_type' to re. ( #2877 )
...
This is only available before python 3.7 based on:
https://github.com/python/cpython/blob/3.6/Lib/re.py#L283
https://github.com/python/cpython/blob/3.7/Lib/re.py
2019-03-20 01:20:24 +01:00
Rebecca Chen
03878d732a
Add attribute queue.Queue.queue. ( #2870 )
2019-03-16 22:11:48 +01:00
Rebecca Chen
7b6bb60fe2
Remove an unused import from stdlib/3/importlib/__init__.pyi. ( #2866 )
...
pytype has trouble resolving unused imports, since it looks at usage
to distinguish submodules from other imports.
2019-03-14 19:51:19 +01:00
Guido van Rossum
6b6d8c82ac
Support new ast features and node types introduced in Python 3.8 ( #2859 )
...
Had to adjust the return type of ast.parse() from Module to AST, which
is more truthful anyways.
2019-03-12 16:34:56 +01:00
Vasily Zakharov
34cc5545fe
email.mime.application.MIMEApplication expects data to be bytes, while it should be Union[str, bytes] ( #2855 )
...
Fixes #2831
2019-03-11 20:42:55 +01:00
Vasily Zakharov
e4e19d6e98
Add email.charset.SHORTEST, QP, BASE64 to the stub for Python 2 ( #2857 )
...
Also mark Python 3 constants as undocumented.
Fixes #2830
2019-03-11 20:41:19 +01:00
Vasily Zakharov
08555f80d1
Make vars arguments Optional, as they default to None ( #2853 )
...
Closes #2847
2019-03-11 15:12:35 +01:00
Jelle Zijlstra
832bf52c28
asyncio: make type alias private and CamelCase ( #2849 )
2019-03-11 08:43:00 +01:00
Chen Li
012901e318
[asyncio] Change _set_running_loop(loop: AbstractEventLoop) to _set_running_loop(loop: Optional[AbstractEventLoop]) ( #2828 )
2019-03-11 00:29:53 +01:00
Gleb Chipiga
6282e9f59f
Update asyncio streams stub ( #2845 )
...
* Add is_closing and wait_closed methods to StreamWriter [Python 3.7]
* Update type of open_unix_connection and start_unix_server path parameter [Python 3.7]
2019-03-11 00:15:03 +01:00
Eric Traut
ef5fc92b98
Added missing default value annotation ( #2841 )
2019-03-10 12:19:29 +01:00
秋葉
b588d43a32
Add sunder names to enum ( #2822 )
...
Closes #2766
2019-03-06 15:31:53 +01:00
Sean McLemon
17cd91eeb3
multiprocessing.spawn submodule and multiprocessing.pool stubs ( #2823 )
...
Added stub for multiprocessing.spawn submodule and updated multiprocessing.pool stub
Closes #2758
2019-03-05 14:52:02 +01:00
Maxim Kurnikov
b80b2e4b98
make IMapIterator a subclass of Iterator ( #2814 )
2019-03-05 10:15:25 +01:00
Jelle Zijlstra
14e387b6fd
fix some minor lint errors ( #2820 )
...
Caught by a newer version of flake8
2019-03-01 12:29:23 +01:00
Ivan Levkivskyi
3d638b0677
Revert "Fixing signature for Mapping.get's default parameter ( #2810 )" ( #2817 )
...
This reverts commit 3f83195558 .
2019-02-27 18:09:46 +00:00
Aymeric Augustin
af9082c302
Fix signature of asyncio.create_connection. ( #2756 )
...
* local_addr and server_hostname are optional and default to None.
* If sock is given, none of host, port, family, proto, flags and
local_addr should be specified.
2019-02-23 10:04:15 -08:00
Mark Mendoza
3f83195558
Fixing signature for Mapping.get's default parameter ( #2810 )
2019-02-22 21:20:02 -08:00
Jukka Lehtosalo
306b4694ae
Remove redundant definition of ast.PyCF_ONLY_AST ( #2803 )
...
This gets imported from `_ast`, so the definition was
redundant. This causes problems with the new mypy semantic
analyzer, as it will flag the redefinition as an error.
2019-02-20 17:12:11 +00:00
Ivan Levkivskyi
0b8e32269a
Fix named tuple name in posix.pyi ( #2800 )
2019-02-15 17:39:27 -08:00
Rebecca Chen
d275e73e1f
Remove pytype workaround in os/__init__.pyi. ( #2797 )
...
Pytype release 2019.02.13 fixed the bug that
necessitated this workaround.
2019-02-14 12:29:19 -08:00
Sebastian Rittau
0989d9507e
Fix groupby with key=None ( #2794 )
...
Cf #2790
2019-02-13 08:45:24 -08:00
Alun Champion
9b545a01ab
Added Optional[] around the itertools.groupby() key attribute to allow None to pass the type ( #2790 )
...
Fixes #2788
2019-02-12 11:59:37 +01:00
Michael Brandt
1442cc02bf
Add stubs for HTTP Handler classes in py2/urllib2 & py3/urllib.request ( #2710 )
...
* HTTP Handler class annotations for py2/urllib2 & py3/urllib.request
Add full annotations for the following classes:
* Python 2:
* `urllib2.AbstractHTTPHandler`
* `urllib2.HTTPHandler`
* `urllib2.HTTPsHandler`
* Python 3:
* `urllib.request.AbstractHTTPHandler`
* `urllib.request.HTTPHandler`
* `urllib.request.HTTPsHandler`
This information is largely undocumented, and was obtained by directly examining
the Python source code:
* Python 2 (v2.7.15) - https://github.com/python/cpython/blob/v2.7.15/Lib/urllib2.py#L1115-L1243
* Python 3 (v3.7.1) - https://github.com/python/cpython/blob/v3.7.1/Lib/urllib/request.py#L1224-L1364
`urllib2.AbstractHTTPHandler.do_open` takes as a parameter either
`HTTPConnection` or `HTTPSConnection`--one of the classes, not an instance of
either--and constructs an object using only a few of the parameters that either
constructor could use. `HTTPConnectionProtocol` in `stdlib/2/httplib.pyi`
follows a similar patten to `HTTPConnectionProtocol` added to
`stdlib/3/http/client.pyi` in pull request #2582 to describe the type of the
`http_class` that is passed to `do_open`.
2019-02-11 11:25:02 +01:00
Joshua Oreman
f8612a77bb
Make AsyncGenerator.aclose() properly return Awaitable[None] ( #2786 )
...
Fixes #2785 . The rationale is discussed there.
2019-02-10 22:35:17 -08:00
Utkarsh Gupta
1a37368cc0
__init__.pyi: Add __getitem__() to stat_result() ( #2753 )
...
Fixes #2751
2019-02-09 16:07:10 +01:00
Aymeric Augustin
503cbb97a3
Fix signature of asyncio.create_server. ( #2763 )
...
* host may be None to bind to all interfaces.
* If sock is given, host and port shouldn't be specified.
2019-02-09 15:45:09 +01:00
Josh Morton
b0eb6c2eae
Improve the stubs in charset.pyi under python3. ( #2768 )
...
The python3 charset stubs didn't include certain necessary module level
constansts (like `QP`) and wrongly defined the arguments to some of
the functions in the module. This is no longer the case.
Fixes #2767
2019-02-09 15:29:49 +01:00
Joel Rosdahl
3eb66ba633
Add type annotation for collections.deque.__iadd__ ( #2774 )
...
* Add type annotation for collections.deque.__iadd__
Fixes #2771 .
2019-02-01 19:39:09 +01:00
Tomer Keren
be99a2a5f0
Use a more accurate type for predicates in itertools ( #2732 )
...
The only constraint on the return value of a predicate is to be "boolable".
Because `bool` recives an object in the constructor https://github.com/python/typeshed/blob/master/stdlib/2and3/builtins.pyi#L803 this is a more accurate description of a predicate.
2019-01-10 11:30:28 -08:00
Ethan Smith
ad304cb9ee
Use overlapped signatures of _winapi functions ( #2723 )
...
For python/mypy#6148
2019-01-07 11:39:26 +01:00
Savo Kovačević
eb6dbe510d
Fix unittest.TestCase assert methods' argument names ( #2724 )
...
And fix assertNotAlmostEqual overloads
2019-01-05 17:31:32 -08:00
Diogo Magalhães Martins
f4aed1fd40
Fixing type for asyncio.StreamWriter reader init parameter ( #2719 )
...
Closes #2718
2018-12-28 17:56:38 +01:00
Tomer Keren
d9a202e352
Make appropriate ast methods generic ( #2715 )
...
Closes #2714
2018-12-24 20:03:09 +01:00
Sebastian Rittau
eb1788ac39
Merge Python 2 and 3 builtins.pyi ( #2533 )
2018-12-21 07:12:41 -08:00