Commit Graph

85 Commits

Author SHA1 Message Date
Alex Waygood d0f2be92ab Bump pyright to v1.1.360 (#11810) 2024-04-24 14:09:16 +02:00
renovate[bot] 48106feed7 chore(deps): update pytype and pyright (#11595) 2024-03-14 09:28:09 +01:00
Shantanu 470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Sebastian Rittau 53a8193d64 Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2024-01-05 08:15:19 -08:00
Sebastian Rittau 23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Alex Waygood 10febc4fe0 stdlib: remove unused type: ignore comments (#11061) 2023-11-23 14:00:07 +01:00
Jelle Zijlstra 4deef7550f stdlib: Fix more signatures with unrepresentable defaults (#11007) 2023-11-09 18:20:09 -08:00
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: https://github.com/tox-dev/py-filelock/blob/79ec7b2826e33b982fe83b057f359448b9d966ba/src/filelock/_api.py#L207

* Improve `opentracing/scope` annotation

Source code here: https://github.com/opentracing/opentracing-python/blob/3e1d357a348269ef54d67f761302fab93dbfc0f7/opentracing/scope.py#L71

* Improve `redis/client` stub

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/client.py#L1217

* Improve `redis/lock` annotation

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/lock.py#L155

* Improve `requests/models` annotation

Source code here: https://github.com/psf/requests/blob/d718e753834b84018014a23d663369ac27d1ab9c/requests/models.py#L653
2022-01-09 19:16:19 -08:00