Commit Graph

1096 Commits

Author SHA1 Message Date
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
Juan Gonzalez
76a334daeb Complete unittest.TextTestResult stubs (#2700) 2018-12-21 08:37:33 +01:00
Dave Halter
2cedbc7d63 Add missing attributes of type (#2544)
All these attributes can be seen when using `dir(type)`.

In the future we should be discussing if certain methods on object (like
__eq__) should really be there. IMO this should be defined on type where it
actually also appears when using `dir`.
2018-12-20 20:01:40 -08:00
Juan Gonzalez
c18b75b2e6 Make mypy aware of IMapUnorderedIterator (#2701) 2018-12-20 19:41:58 -08:00
Jelle Zijlstra
46ab77eb20 loop argument to asyncio.ensure_future is Optional (#2708)
The default value is None: https://github.com/python/cpython/blob/master/Lib/asyncio/tasks.py#L616.
2018-12-20 15:24:03 -08:00
Ville Skyttä
0956a24eb2 bytes/bytearray.startswith fixes (#2696) 2018-12-17 18:57:07 +01:00
Dave Halter
5c69373890 macpath, os/path, posixpath and ntpath should basically be the same files (#2637) 2018-12-17 15:02:18 +01:00
gnattishness
ea0dbfa313 Fix typo for Message.add_attachment in message.pyi (#2697) 2018-12-15 19:11:15 -08:00
Michael J. Sullivan
95afb86022 Move posix.stat_result to os.stat_result on python 3 (#2683)
In python 3, posix.stat_result is a re-export of os.stat_result, while
in python 2 it was the reverse. Update typeshed to reflect this.
2018-12-13 19:20:42 +01:00
Andrew Svetlov
b9be76c255 Task.current_task() and Task.all_tasks() have an optional loop parameter (#2690) 2018-12-12 13:18:18 -08:00
Kostya Esmukov
2469a3ccda Fix signature of ConfigParser's dict_type argument (#2684) 2018-12-12 08:22:31 +01:00
Sander Voerman
1b24d80087 Add get_loop() to asyncio.Future [Python 3.7] (#2680) 2018-12-09 21:37:37 +01:00
Guido van Rossum
e08a5ac367 Tweak how ast.pyi imports typing (#2668)
When we import typeshed internally at Dropbox, somehow the fact that
these files are all stubs gets lost (it's a long story...).  This
causes errors like this:

  .../stdlib/2/ast.pyi:6: error: Name 'typing' already defined (by an import)

The quickest way around this is to rename the import to _typing.
2018-12-04 17:25:23 +01:00
Brandt Bucher
ac8f5da324 Replace Loader with PEP 451 _Loader protocol in _importlib_modulespec.pyi annotations. (#2626) 2018-12-03 21:26:37 +01:00
Utkarsh Gupta
bee236fb5d builtins.pyi: Return complex from __(r)pow__() (#2662)
Closes #1406
2018-12-03 14:21:27 +01:00
Utkarsh Gupta
9f9d15e311 itertools.pyi: Allow omitting repeat argument in Python 3 (#2659)
Fixes #2561
2018-11-30 15:58:21 -08:00
Guido van Rossum
de50614957 Stop inheriting Sized in collection ABCs (#2658)
Instead define abstract __len__ in affected classes.

Fixes #2655 without breaking
https://github.com/rominf/ordered-set-stubs/issues/1
2018-11-30 13:10:35 -08:00
Jukka Lehtosalo
84548f5bba Revert "fix list concatenation (#2404)" (#2653)
The fix caused regressions for mypy that are difficult to
fix.  See https://github.com/python/mypy/issues/5492 for
context.

This reverts commit 1a42a2c3ea.
2018-11-29 12:20:29 -08:00
anentropic
98e63d2d2f staticmethod and classmethod can wrap any callable (#2650)
Closes: #2645
2018-11-29 14:36:08 +01:00
Brandt Bucher
1857435e6f types.CodeType.co_filename isn't Optional. (#2639) 2018-11-27 20:53:05 -08:00
Florian Bruhin
489180ffcc Add stubs for the faulthandler stdlib module (#2627) 2018-11-26 16:39:47 +01:00
Dave Halter
96ed18f6e1 Add posix attributes for Python 3 (#2631)
The posix module in Python 3 lacks some attributes that are present in both
os/__init__.pyi and Python 2's posix.pyi
2018-11-26 14:39:12 +01:00
Dave Halter
84daf7c93b Add __getnewargs__ to float, int, bool, str, bytes, unicode (#2632) 2018-11-26 10:43:12 +01:00
Sebastian Rittau
517d2b6012 Remove unneeded ignores (#2624) 2018-11-23 09:51:44 -08:00
Brandt Bucher
7685462672 Add complete annotations to builtins.compile. (#2606) 2018-11-20 17:48:24 +01:00
Sebastian Rittau
cd75801aa5 Replace non-ellipsis default arguments (#2550) 2018-11-20 07:35:06 -08:00