Commit Graph

1396 Commits

Author SHA1 Message Date
Julian Andres Klode 009b269882 fcntl: make mutate_flag optional for ioctl w/ read-only buffer (#3882)
Fixes #3881
2020-03-24 15:54:59 +01:00
Debjyoti Biswas e571d1a2c2 Change Task[Any] to Task[_T] in return statements (#3878) 2020-03-24 15:46:03 +01:00
Rodrigo Castro 4b14e245d4 Mock and MagickMock subclassing NonCallableMock (#3871) 2020-03-24 15:32:57 +01:00
Debjyoti Biswas 66c20e6b43 Add stub for typing.ForwardRef (#3876)
* Add stub for class ForwardRef

* Add anotation for localns

* PEP8 and add version info check
2020-03-22 08:51:59 -07:00
Ben Motz c12162e4a1 add missing multiprocessing.connection.Connection context manager methods (#3875)
Co-authored-by: Ben Motz <ben.motz@bluwireless.com>
2020-03-22 08:50:50 -07:00
Debjyoti Biswas 6d3af1c472 Add stubs for multiprocessing.managers.Token (#3872) 2020-03-22 08:47:15 -07:00
Rodrigo Castro ef1d7853ee stdlib.3.unitest.mock.NonCallableMock signatures (#3846) 2020-03-20 14:37:18 +01:00
Debjyoti Biswas 24691fa03a Adding stubs for multiprocessing.managers BaseProxy (#3868) 2020-03-20 12:11:53 +01:00
Oleg Höfling dc060fac2a on windows, resolve proactor and selector event loop policies only for python 3.7 and newer (#3866)
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
2020-03-18 17:42:01 -07:00
Debjyoti Biswas c0938525d8 Add methods for subnet_of and supernet_of (#3851) 2020-03-17 10:06:49 +01:00
Shantanu 4b360ca2c8 TypedDict: fix keys, values, items return value (#3529)
Fixes #3473

Co-authored-by: hauntsaninja <>
2020-03-13 21:03:22 -07:00
Ben Leslie 01d4a4c395 Change return type of Future.exception to be Optional[BaseException] (#3849)
Future.exception can return None if no exception was capture in the future.
As documented: https://docs.python.org/3/library/asyncio-future.html#asyncio.Future.exception
2020-03-13 20:38:58 -07:00
Tim Hatch 508fd84499 Expand tokenize stub to include Intnumber etc (#3839)
The all uppercase tokens, as well as tok_name mentioned in the comment
actually come from the `from token import *`.
2020-03-11 10:54:19 -07:00
Andrew Svetlov 52d3b9eaba Fix remove_child_handler() return type (#3841) 2020-03-11 14:50:06 +01:00
Jukka Lehtosalo 5162c536c8 Make attributes of inspect.ArgSpec optional in Python 3 (#3838)
This makes them consistent with Python 2 stubs.

The attributes are documented here:
https://docs.python.org/3/library/inspect.html#inspect.getargspec
2020-03-10 13:15:20 +01:00
Shantanu d8b081130d email.mime: add policy arguments (#3827) 2020-03-08 16:06:55 +01:00
Shantanu 2d3635f10d os: fix platform availability (#3832) 2020-03-07 12:59:55 +01:00
Shantanu de4305760d configparser: add undocumented parameter to SectionProxy.get (#3826) 2020-03-07 12:46:32 +01:00
Shantanu c478d3aa98 asyncio: add arguments to subprocess_shell (#3825) 2020-03-07 12:45:30 +01:00
Ran Benita 92d53086be stdlib/3/ast: add visit_* methods to NodeVisitor (#3796)
NodeVisitor recurses over an AST tree. When encountering a node, it
checks if a method called `visit_{node.__class__.__name__}` exists, and
calls it if so, otherwise calls the generic visitor.

Add the possible methods to NodeVisitor. This is not exactly correct,
since the methods don't *actually* exist on NodeVisitor, e.g.
`NodeVisitor().visit_Module(...)` doesn't work. But it's nice for
subclasses to know which methods they can override and which type they
should have.
2020-03-06 13:15:04 +01:00
Shantanu 89afe1e014 statistics: fix median_grouped, NormalDist.samples (#3818) 2020-03-06 11:34:04 +01:00
Shantanu af09df9b48 textwrap: various fixes (#3819) 2020-03-06 11:12:24 +01:00
Shantanu 009e650a1d string: various fixes (#3814) 2020-03-06 11:02:18 +01:00
Shantanu 11d300587e urllib: various fixes (#3813) 2020-03-06 11:01:19 +01:00
Ivan Levkivskyi 8b28b49c61 Mark some obviously incomplete stubs as incomplete (#3807) 2020-03-04 17:02:14 +00:00
Rune Tynan efebe6bcec Add venv module stub (#3783) 2020-03-03 10:48:52 +01:00
petsuter 95002966ec Annotations for Py3.6 tkinter additions (#3778) (#3797)
* Add tkinter.Variable.trace_add()
* Add tkinter.Variable.trace_remove()
* Add tkinter.Variable.trace_info()
https://docs.python.org/3.6/whatsnew/3.6.html#tkinter
2020-03-01 08:53:01 -08:00
Rune Tynan 3926e88d13 Add macurl2path stub (#3785)
* Add macurl2path stub, types based on urllib

* Fix types, remove undocumented

The whole module is undocumented, no reason to just mention it on one call

* Module was removed in 3.7, stubtest shouldn't care about it

* Module was removed in 3.7, stubtest shouldn't care about it
2020-02-29 22:03:50 -08:00
Ran Benita 0705cd6435 stdlib/3/importlib/metadata: add missing "group" attribute to EntryPoint (#3795) 2020-02-29 14:26:24 +01:00
Shantanu ab36ecb784 io: add open_code for py38 (#3769) 2020-02-22 12:53:16 +01:00
lazytype cfe69831e9 Include typing for Enum __order__ attribute (#3541)
Based on the behavior here: https://github.com/python/cpython/blob/0b41a922f95f62b620d5a197b9f2ed8e4bb70730/Lib/enum.py#L91
the `__order__` attribute should be treated the same as `_order_`
2020-02-21 21:40:33 -08:00
Rune Tynan 9425e359fc Add missing parameter types for _json (#3710)
* Add missing parameter types for _json make_encoder

* Fix json typings
2020-02-21 21:37:24 -08:00
Shantanu ed2d3543c7 functools: add singledispatchmethod (#3764) 2020-02-21 21:36:47 -08:00
Shantanu 1b7eadce95 fcntl: various improvements (#3680)
* fcntl: mark positional-only args

* fcntl: use overload for fcntl.fcntl

The comment about depending on the type of arg seems incorrect
https://github.com/python/typeshed/commit/bf501353a0668369e53cc1bc97250bb14f61a09e

I checked the docs and examples, CPython implementation and CPython tests, but
I might be missing something

* fcntl: use overload for fcntl.ioctl

Based off of docs and examples

* fcntl: type buffers better

Follows the approach in #2610
2020-02-21 21:31:58 -08:00
Shantanu b1071639b9 sre_parse: various fixes (#3758)
* sre_parse: NIC is stub implementation detail

* sre_parse: add missing arg to Tokenizer.getuntil

* sre_parse: fix types for parse

* sre_parse: fix types for SubPattern.__init__

* sre_parse: fix arg name for fix_flags

* sre_parse: update whitelists

* sre_parse: fix some availability for py35
2020-02-21 21:23:34 -08:00
Shantanu ff7680cbfe inspect: various fixes (#3757)
* inspect: fix BlockFinder.tokeneater args

* inspect: fix formatargspec

* inspect: fix formatargvalues

* inspect: fix various arg names

* inspect: update whitelists
2020-02-21 21:23:21 -08:00
Shantanu 003fc6fa31 json: mark keyword-only args, remove deprecated arg (#3756)
* json: mark keyword-only args

Technically only true for Python 3.6+, but I didn't feel like copying
over the whole file just for Python 3.5. Let me know and I can.

* json: remove encoding from loads

This has been ignored and deprecated since 3.1 and will be removed in 3.9
It no longer even shows up in inspect.signature (in 3.8 it emits the
deprecation warning based on kwargs)

* json: update whitelists
2020-02-21 21:21:32 -08:00
Shantanu 5a2f4c8cde sys: various fixes (#3762)
* sys: simplify _getframe

* sys: mark positional-only args

* sys: fix platform availability

* sys: remove settscdump

This function is no longer documented in 3.6 and above (and doesn't
exist on master, was removed in 4fd64b9a6aba9e6e1a5d).
In 3.5 documentation it's mentioned that it's only available if Python
was compiled with a special flag:
https://docs.python.org/3.5/library/sys.html#sys.settscdump

* sys: update whitelists
2020-02-21 20:58:42 -08:00
Oleg Höfling 6600dabd5c import SelectorEventLoop from asyncio.unix_events when not on windows (#3753)
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
2020-02-21 20:49:31 -08:00
Shantanu 82d7638018 gc: fix arg name, mark positional-only args (#3760) 2020-02-21 20:38:59 -08:00
Shantanu 406593f6cc tempfile: various fixes (#3763)
* tempfile: add errors parameter in py38

* tempfile: add property to SpooledTemporaryFile

* tempfile: fix arg name

* tempfile: better document some of what's going on

* tempfile: update whitelists
2020-02-21 20:35:37 -08:00
Shantanu 1fb46cb4d1 ast: add visit_Constant to NodeVisitor (#3767) 2020-02-21 20:26:15 -08:00
Shantanu d89ab2a37d _imp: mark positional-only args (#3770) 2020-02-21 20:20:24 -08:00
Oleg Höfling 02784bb068 inspect._ParameterKind subclasses from enum.IntEnum (#3750)
Closes #3467.
2020-02-21 14:30:15 +01:00
Shantanu 374992bff7 resource: various fixes (#3747)
* resource: mark positional-only args
* resource: alias error to OSError
* resource: no longer seems incomplete

At least for Linux and Mac. Might be some things missing for FreeBSD

* resource: fix platform availability
* resource: update whitelist
2020-02-21 11:57:07 +01:00
Shantanu a19caac361 os.path: fix arg names (#3748) 2020-02-21 11:55:21 +01:00
Shantanu 87791e4e15 re: various fixes (#3746)
* re: mark positional-only args

* re: fix escape arg name

* re: update whitelist
2020-02-21 11:55:11 +01:00
Anthony Sottile 9ec0bcf7e4 Add cookie_re / blank_re to py3 tokenize (#3745) 2020-02-20 23:10:30 +01:00
Thomas Schaper 91deb7a79f Make FrameType.f_back optional (#3740) 2020-02-16 19:40:10 +01:00
Mark 39008d51c1 Make itertools.cycle a type (#3732) 2020-02-09 13:34:41 +01:00