Commit Graph

78 Commits

Author SHA1 Message Date
Alex Waygood
a08d4c8d2e Remove many redundant inheritances from Generic[] (#10933) 2023-10-26 20:07:20 +02:00
Alex Waygood
a0b2583bb1 Add OrderedDict.__(r)or__ (#10770) 2023-09-25 06:47:02 -07:00
Alex Waygood
6dda2fe9c8 Fix stubtest complaints for various .get() methods (#10690) 2023-09-10 14:48:09 -07:00
Alex Waygood
6eec191739 Improve the accuracy of (default)dict.__(r)or__ (#10679) 2023-09-08 11:22:17 +01:00
Eugene Toder
e86c61da86 More precise overloads for get/pop methods (#10501)
Fixes #10293

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-07-26 16:37:32 +01:00
Alex Waygood
03b4bb9cce Stdlib: add many missing __hash__ and __eq__ methods (#10464) 2023-07-17 14:21:02 +02:00
Eugene Toder
cfc5425cb3 Add defaultdict.__(r)or__; improve ChainMap.__(r)or__ and UserDict.__(r)or__ (#10427)
Add __or__ to defaultdict

Also, add overloads with Self type to other __[r]or__ methods.
2023-07-11 19:39:12 +01:00
Andrew Sansom
18d45d62aa Broaden collections.Counter __iadd__, __isubtract__, __iand__, and __ior__ to accept any mapping (#10397)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-03 08:27:17 +01:00
Akuli
03b8c60a02 Support dict(foo.split() for foo in bar) with bytes (#10072) 2023-04-22 18:28:34 +03:00
Alex Waygood
257e287fec Stdlib: correct many parameter names (#9815) 2023-03-04 09:53:12 +00:00
Alex Waygood
9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood
ccb250940a Improve collections stubs (#9674) 2023-02-06 13:54:15 +01:00
Alex Waygood
1d7dda7fa1 stdlib: Add defaults for positional-only parameters (#9655) 2023-02-01 21:44:08 +00:00
Alex Waygood
9e71de0421 Improve several stdlib setdefault methods (#9612) 2023-01-31 15:39:24 -08:00
Alex Waygood
dd3aedd133 Correct str.maketrans and collections.UserString.maketrans (#9611) 2023-01-29 11:45:08 -08:00
Alex Waygood
33a62ae42d Add more defaults to the stdlib (#9606)
Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00
Alex Waygood
b316dd947e Bump flake8-pyi to 23.1.1 (#9599) 2023-01-28 07:39:30 -08:00
Alex Waygood
d98d1674e7 Fix a few issues with parameter defaults (#9572) 2023-01-20 09:47:59 -08:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Avasam
23ac9bff19 Check for unused pyright: ignore and differentiate from mypy ignores (#9397) 2022-12-28 10:44:29 +00:00
Alex Waygood
9f05e9ff58 Improve classes returned from OrderedDict.{keys(), items(), values()} (#8552) 2022-08-20 22:21:39 +01:00
Nikita Sobolev
510feeb3fc Improve constructor for builtins.dict (#8517)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-08-10 19:04:07 +01:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood
e7a5b7a762 Fix various __all__-related errors and omissions (#8031) 2022-06-07 23:29:55 +01:00
Jelle Zijlstra
d5bc48d29b builtins, collections: Fix unconstrained overloads for container constructors (#7944)
See https://github.com/microsoft/pyright/issues/3501#issuecomment-1135979479

Related to #7928
2022-05-25 10:07:23 +01:00
Alex Waygood
073f9f416d Use PEP 585 syntax in collections (#7657) 2022-04-18 15:33:50 +01:00
Alex Waygood
4e87b9058f Improve collections.Counter stub (#7464) 2022-03-09 12:22:28 +02:00
Alex Waygood
f4ae363b56 stdlib: correct many pos-or-kw arg names in dunder methods (#7451) 2022-03-07 16:40:03 +01:00
Alex Waygood
46da0b87ea Add collections.ChainMap.__bool__ (#7391) 2022-02-27 16:02:01 -08:00
Shantanu
2279c87257 collections: fix some Counter nits (#7313) 2022-02-20 12:13:49 +02:00
Alex Waygood
cc1dd6d6ec Add collections.__all__ (#7296) 2022-02-19 12:26:23 -08:00
Alex Waygood
1091521f60 stdlib: Add several missing __(deep)copy__ methods (#7242) 2022-02-16 18:57:41 -08:00
Alex Waygood
fbc279e3f5 stdlib: Add many missing dunder overrides (#7231) 2022-02-16 06:25:47 -08:00
Alex Waygood
5e8a2a9364 Fix various pos-only stubtest complaints previously allowlisted (#7228) 2022-02-15 17:51:34 +01:00
Alex Waygood
11efe034bb collections: Add missing reflected BinOp methods (#7207)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-14 13:03:40 -08:00
Alex Waygood
66a229b709 stdlib: Add several missing comparison methods (#7202) 2022-02-14 11:09:52 -08:00
Alex Waygood
7f472e94e5 Improve collections.UserString (#7189) 2022-02-13 17:09:06 -08:00
Nikita Sobolev
6882e513c2 Improve Self type usage accross stdlib (#7183) 2022-02-13 12:21:01 +01:00
Alex Waygood
a62fd92fb0 Improve some in-place BinOp methods (#7149) 2022-02-06 15:36:57 -08:00
Shantanu
b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Sebastian Rittau
6746e83f52 Counter/defaultdict: Key type 'str' if initialized with keywords (#7048) 2022-01-28 12:41:58 +02:00
Alex Waygood
2170693e11 Add various __*or__ methods, and improve dict.__ior__ (#6961) 2022-01-19 12:24:16 +01:00
Alex Waygood
96c9abb058 Always use _typeshed.Self, where applicable (#6880)
* Always use `_typeshed.Self`, where applicable

* Revert changes to `google-cloud-ndb` (ambiguous)

* Remove empty line added by script

* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`

* Manually add a few more that the script missed

* Improve `filelock` annotation

Source code here: 79ec7b2826/src/filelock/_api.py (L207)

* Improve `opentracing/scope` annotation

Source code here: 3e1d357a34/opentracing/scope.py (L71)

* Improve `redis/client` stub

Source code here: 15f315a496/redis/client.py (L1217)

* Improve `redis/lock` annotation

Source code here: 15f315a496/redis/lock.py (L155)

* Improve `requests/models` annotation

Source code here: d718e75383/requests/models.py (L653)
2022-01-09 19:16:19 -08:00
Alex Waygood
4e046163b5 Delete many redundant method redefinitions (#6877) 2022-01-09 11:21:03 -08:00
Alex Waygood
a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Akuli
a7886bfa55 Fix several typos in comments (#6830) 2022-01-05 18:44:34 +01:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Alex Waygood
e6911530d4 collections: remove redundant method redefinitions (#6630) 2021-12-19 23:38:42 +01:00
Alex Waygood
12b79f64d7 Remove incorrect deque method overloads (#6628)
As the current comment in the source code states, these methods don't really take slices. It's surely better just to add `# type: ignore` comments, rather than have an incorrect stub.
2021-12-18 12:00:03 -08:00
Alex Waygood
4f7f30a8c4 Use SupportsKeysAndGetItem in most Mapping constructors (#6626) 2021-12-18 11:33:00 -08:00