Commit Graph

3603 Commits

Author SHA1 Message Date
Peter Law
9b86402c77 pickle: use protocols instead of IO[bytes] (#6101) 2021-10-02 11:32:16 +03:00
Matthew Suozzo
947e851cf8 Remove typevar in mock.patch.multiple (#6090) 2021-09-30 19:14:10 +02:00
MapleCCC
b04512eaaa Fix return type of st2tuple() and STType.totuple() (#6091) 2021-09-30 09:35:38 +02:00
hardikpnsp
fe4062af54 Fix "value" types in dump and dumps (#6085) 2021-09-29 15:07:29 +02:00
Kumar Aditya
25ae5b8871 Add __await__, name, qualname to CoroutineType (#6087) 2021-09-29 14:07:09 +02:00
Matthew Suozzo
9efd6521be Fix unittest.mock.patch class decorator annotation. (#6070) 2021-09-29 09:27:47 +02:00
Luciano Ramalho
b99ddc1f2f change chained maps to MutableMapping (#6044)
Fixes #6042
2021-09-28 21:18:50 -07:00
Nikita Sobolev
4ac969ad2c Fixes __init__ of typing.NamedTuple (#6080)
Closes #6079
2021-09-28 20:42:27 -07:00
Zac Hatfield-Dodds
7cc5eb2950 StackSummary.extract() takes an Iterable (#6084) 2021-09-28 09:24:54 +02:00
Vincent Pelletier
4c0dccac0f Fold remaining custom stdlib *Buffer types into _typeshed. (#6082)
Add ctypes base type to WriteableBuffer.
Add a ReadOnlyBuffer type from fcntl.
Base ReadableBuffer on WriteableBuffer and ReadOnlyBuffer.
Use these types in fcntl and ctypes stubs.
2021-09-28 09:15:26 +02:00
Ju4tCode
328d09a9a5 Fix error type for inspect Parameter/Signature empty (#6073) 2021-09-27 13:49:22 +02:00
Nikita Sobolev
3bc309daaa Adds AM_STR and PM_STR to locale.py (#6065) 2021-09-24 10:51:33 +02:00
Estelle Poulin
15cec1da8e Change Traversable to be inline with pathlib.Path (#5818)
`pathlib.Path` objects are now valid `importlib.abc.Traversable`s.
2021-09-21 21:36:10 +03:00
Akuli
196f69b27e dict.__init__: support dict(string.split(sep) for string in iterable) (#6050) 2021-09-20 13:52:41 +02:00
KotlinIsland
1b5c4e1d57 Add support for dict.{keys,values,items}.mapping (#6039)
Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com>
2021-09-19 22:30:14 -07:00
Anton Grübel
caa642dd3b improve typing in inspect (#6020) 2021-09-18 20:11:55 -07:00
Rebecca Chen
d74a5a9ef8 Add undocumented attribute multiprocessing.process.BaseProcess._identity (#6041)
A user filed an issue against pytype about this attribute being missing:
https://github.com/google/pytype/issues/1010. I determined its type from
the source code:
https://github.com/python/cpython/blob/3.9/Lib/multiprocessing/process.py.
2021-09-17 13:14:07 -07:00
SupImDos
e4c2c0f302 Add SysLogHandler.address attribute (#6037) 2021-09-14 13:58:02 +02:00
Bas van Beek
a1ca55037a Update the xxhash and hashlib stubs (#6031)
* `name`, `block_size`, `digest_size` and `digestsize` attributes of hash objects were made read-only.
* It is now a type-checking error to subclass `xxhash` classes, such as `xxhash.xxh32`. Previously it was an error only at runtime.
* `xxhash` functions now accept strings as input and any object with `__index__()` method for `seed` (instead of requiring an integer). They also fail the type checking if no arguments are given.
2021-09-14 12:01:11 +03:00
Sebastian Rittau
ca38856670 Fix set annotations in concurrent.futures._base (#6034) 2021-09-14 11:50:20 +03:00
Sebastian Rittau
b562d233ae (a)next only requires __(a)next__, not Iterator (#6036) 2021-09-14 11:43:21 +03:00
Screwtapello
4c6e98ed0c Add many missing tkinter type annotations (#6002)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-09-12 11:42:12 +03:00
Shantanu
8576b344b8 binhex: removed in py311 (#6011) 2021-09-10 15:27:24 -07:00
Sander
7bfdacb4c4 stdlib/logging use object over Any for parameter types (#6025) 2021-09-10 16:04:32 +02:00
Akuli
e69ca588ac Stubs for ttkthemes (#6024) 2021-09-10 15:59:12 +02:00
Sebastian Rittau
9295c70ec0 'module' argument to ForwardRef.__init__() added in Python 3.9.7 (#6017)
Pin Python 3.9.7 for stubtest and update 3.10.0 to rc2
2021-09-10 01:10:28 +02:00
Sebastian Rittau
2f3964e24b Return ItemsView/KeysView from Mapping methods (#6014)
* Return ItemsView/KeysView from Mapping methods

* Make RawConfigParser compatible with Mapping
2021-09-09 07:37:26 -07:00
Bas van Beek
b9e1d7d522 Replace Mapping with types.MappingProxyType (#6013)
Mark `Signature.parameters` and `.return_annotation` as read-only properties
2021-09-09 09:58:53 +02:00
Bas van Beek
d599a535b2 Allow math.trunc to only accept __trunc__-supporting objects (#6003)
Add SupportsTrunc protocol
2021-09-04 18:16:53 +02:00
Anton Grübel
3819f8e6ff add missing functions in sys (#6001) 2021-09-04 16:30:13 +02:00
Andrew Svetlov
c0030b2b12 Fix msg parameter type for asyncio Future.cancel() and Task.cancel() (#5999) 2021-09-03 09:07:20 -07:00
HunterAP23
ffaa0ea3d1 Added initial rework of the concurrent.futures module (#5646)
* Added initial rework of the concurrent.futures module

* Minor fixes

* Fixed some generics & changed to collections over typing for some types

* Switched thread to use queues instead of multiprocessing.queues

* More fixes

* More fixes following results from running tests locally

* Tmp commit of changes

* Minor flake8 fix

* Fixing some issues

* Fixed a weakref.ref issue

* Fixed one more weakref issue

* Fixed some issues with required version

* Fixed more python min version requirements

* More min version fixes

* Fixed misc error in workflow regarded outdated pip

* Replaced any usage of Optional and Union with proper form as described in the contributions guide

* Fixed issue with using Callable definition

* Fixed last seen issues as per review

* Fixed some basic issues & more proper import calls

* Update stdlib/concurrent/futures/process.pyi

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>

* Update stdlib/concurrent/futures/process.pyi

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>

* Minor fixes

* More minor fixes

* Fixed up some issues & cleaned up imports

* Removed usage of Union

* Changed wait method to use Set of Future to work with mypy-primer for Optuna repo

* Reverted change to wait method and DoneAndNotDoneFutures class

* Fixed DoneAndNotDoneFutures again

Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-09-03 13:06:48 +02:00
Anton Grübel
1af6810b5d Improve typing in zipfile (#5991)
* Improve typing in zipfile

* fix CR suggestions
2021-09-03 13:02:11 +02:00
Carl Meyer
003f916acd Add SymbolTableFactory to symtable stub (#5998)
This is not documented API, but AFAIR the typeshed policy is now that stubs should preferably reflect reality rather than solely documented API.

See https://github.com/python/cpython/blob/main/Lib/symtable.py#L21
2021-09-03 00:15:17 -07:00
Peter Law
425a35309a Relax DictWriter.fieldnames closer to implementation (#5994)
Fixes #5993
2021-09-02 20:17:30 +02:00
Anthony Sottile
f1e367851c Fix types of enum _member_names, etc. (#5986)
Move fields onto EnumMeta
2021-09-02 11:46:57 +02:00
Torsten Wörtwein
d4f0725452 BUG: typing.final supports properties (#5985)
Fixes #5984
2021-08-31 09:07:57 +02:00
Akuli
8d5452e873 do not use mypy-specific syntax in '# type: ignore' comments (#5953) 2021-08-29 03:58:34 -07:00
Shantanu
2d4fcbc81e zipfile: py310 changes, fix open (#5979)
Co-authored-by: hauntsaninja <>
2021-08-28 22:45:01 +02:00
Shantanu
ba998cd5f9 multiprocessing.pool: fix __init__ methods (#5833)
Co-authored-by: hauntsaninja <>
2021-08-28 12:04:08 -07:00
Anton Grübel
ac2ef6e8c9 Use paramspec in no_type_check_decorator (#5942) 2021-08-26 22:46:27 +03:00
Jon Dufresne
ac39a73d38 Add type for undocumented copyreg.dispatch_table (#5959) 2021-08-26 00:59:23 +02:00
Anders Kaseorg
65a88ace0a Add email.message.Message.__iter__ (#5960)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-08-25 22:43:20 +02:00
Oleg Höfling
a74624d31b Introduce generic logger type in loggeradapter (#5954) 2021-08-25 05:45:56 -07:00
Ruben Opdebeeck
e567af01e5 Fix collections.UserString __reversed__ and __iter__ (#5958) 2021-08-25 15:27:20 +03:00
Alex Nelson
d34d047002 Add DOOR, PORT, and WHT type signatures for stat module (#5955)
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
2021-08-24 21:22:24 +02:00
Anton Grübel
29c63e0d9c add ParamSpec to importlib.util (#5944) 2021-08-21 08:24:25 -07:00
Anton Grübel
2f499c7e90 add ParamSpec to trace.runfunc (#5940) 2021-08-20 10:46:34 +02:00
Niklas Gustafsson
918c7d0b84 Add ZipInfo type hint to members argument of ZipFile.extractall (#5936) 2021-08-20 10:43:45 +02:00
Anton Grübel
c54909ab69 Use ParamSpec for unittest.signals.removeHandler() (#5905) 2021-08-19 18:32:24 +02:00