Commit Graph

142 Commits

Author SHA1 Message Date
Sebastian Rittau
630b49a291 Replace various Incompletes in stdlib (#11673)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-01 15:20:01 +01:00
Sebastian Rittau
027115e624 Remove bare incompletes (#11670) 2024-03-30 18:35:57 -07:00
Jelle Zijlstra
a6bdb25991 typing: Deprecate creating a NamedTuple with kwargs (#11567)
c5fa796619/Lib/typing.py (L2874)
2024-03-10 16:20:35 -07:00
Avasam
1a942aa36d Replace Flake8 checks with Ruff (except for flake8-pyi) (#11496)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-10 14:35:45 +00:00
Shantanu
470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Alex Waygood
c49c84f319 A new shade of Black (#11362) 2024-02-04 16:38:55 -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
Viicos
54447f63a4 Use type instead of Type in typing.pyi (#11235) 2024-01-04 05:04:43 -08:00
Alex Waygood
0b36e65877 Remove redundant sys.version_info condition (#11087)
We're already inside an `if sys.version_info >= (3, 12)` block here; no need to check if `sys.version_info >= (3, 10)`
2023-11-29 19:10:48 +00:00
Alex Waygood
ef346aba0d Fixes to typing and typing_extensions stubs (#11086) 2023-11-29 19:00:58 +00:00
Alex Waygood
8023ba764a Remove redundant inheritances from Generic and various typing protocols (#10981) 2023-11-06 14:00:25 +01:00
Alex Waygood
a08d4c8d2e Remove many redundant inheritances from Generic[] (#10933) 2023-10-26 20:07:20 +02:00
Jelle Zijlstra
31495e53bd typing.pyi: IO.name may be bytes (#10738) 2023-09-20 08:24:22 +02:00
Alex Waygood
433204fb8f py312: Fix stubtest nits in typing/typing_extensions (#10659) 2023-09-04 15:39:11 +01:00
Alex Waygood
df08fcec5f Improve __(r)or__ signatures for TypedDict classes (#10565) 2023-08-12 18:27:35 +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
Jelle Zijlstra
f577c4c133 Update typing_extensions for 4.7.* (#10344) 2023-07-22 12:51:22 +01:00
Alex Waygood
03b4bb9cce Stdlib: add many missing __hash__ and __eq__ methods (#10464) 2023-07-17 14:21:02 +02:00
Alex Waygood
81b8211d0e Revert "Remove un-needed __hash__ methods from stdlib (#8465)" (#10426)
Reverts https://github.com/python/typeshed/pull/8465
Fixes https://github.com/python/typeshed/issues/10424
Closes https://github.com/python/typeshed/pull/10425

https://github.com/python/typeshed/pull/8465 caused regressions: see https://github.com/python/typeshed/issues/10424 and https://github.com/python/mypy/issues/13800. Since it didn't fix any known problems (just some stylistic nits that we had), let's just revert the PR.
2023-07-09 08:43:32 -07:00
James Hilton-Balfe
4cfc49882e Rename Generator-like type params to be more obvious (#10330)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-21 13:50:33 +01:00
Alex Waygood
640676bdb2 Mark arguments of typing.NamedTuple.__init__ as positional-only (#10292) 2023-06-11 12:28:01 +02:00
Sam Bull
e11dbc20da Add missing __eq__ to Mapping (#10297)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-10 13:56:08 +01:00
Shantanu
d6a85e2c48 Attempt to clarify the ByteString situation (#9783)
See https://github.com/python/cpython/issues/102092

This makes the behaviour of typing.ByteString better match its
documentation.
2023-05-27 21:37:38 -07:00
Alex Waygood
bb701b09db Improve NamedTuple stubs (#10220) 2023-05-25 08:37:52 -07:00
Alex Waygood
4190dbca10 Add __orig_bases__ to TypedDict classes (#10221) 2023-05-25 08:34:31 -07:00
Jelle Zijlstra
185adf01a9 Clean up stubtest allowlist for typing (#10205) 2023-05-24 20:33:46 +01:00
Jelle Zijlstra
e4dcfccbd5 Update typing-extensions; some 3.12 updates (#10200)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-24 11:06:55 -07:00
Sebastian Rittau
027460f11a Remove unnecessary ellipsis expressions (#9976)
Ignore flake8 F821 warnings in stub files
2023-03-29 13:28:06 +02:00
Alex Waygood
dd2818a41d Stdlib: add container default values (#9909) 2023-03-21 09:12:34 +01:00
Alex Waygood
21d7f7153b [alt] typing: accept buffers in IO.write (#9861)
Co-authored-by: JelleZijlstra <jelle.zijlstra@gmail.com>
2023-03-15 00:42:10 -07:00
Alex Waygood
257e287fec Stdlib: correct many parameter names (#9815) 2023-03-04 09:53:12 +00:00
Stanislav Zmiev
806b13435c Add get_origin annotations (#9811)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-02-25 15:59:37 +00:00
Alex Waygood
6ba28ae547 Remove unused type: ignore comments (#9801) 2023-02-23 12:59:50 -08:00
Shantanu
da9366d016 Add frozen_default to dataclass_transform (#9756) 2023-02-18 15:25:29 -08:00
Alex Waygood
9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood
53747b264e Stdlib: add 'obvious' default values (#9688) 2023-02-07 13:00:40 +01:00
Alex Waygood
c4c4bee8aa Remove a no-longer-needed # noqa (#9685) 2023-02-07 00:43:53 +00: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
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
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Joshua Bronson
1ba0c9815e Fix false positive with calling .register() on KeysView subclass (#9348)
* Revert "`Collection` is `Sized` (#8977)"

This reverts commit 5bbba5d008.

* Revert "typing: remove metaclass from Sized (#9058)"

This reverts commit a3ce512095.

* Add regression test for issue 9296.
2022-12-10 10:09:28 -08:00
Akuli
02f2bc30e7 Make peewee stubs compatible with peewee 3.15.4 (#9176) 2022-11-12 16:12:55 -08:00
Shantanu
a3ce512095 typing: remove metaclass from Sized (#9058)
as per https://github.com/python/typeshed/pull/8977#issuecomment-1297872394
2022-11-01 18:38:52 -07:00
Nikita Sobolev
5bbba5d008 Collection is Sized (#8977) 2022-10-25 06:08:28 -07:00
Nikita Sobolev
327ae91627 ValuesView is a Collection, not Iterable (#8953)
See https://github.com/python/cpython/issues/98500 and 49f61068f4/Lib/_collections_abc.py (L893)
2022-10-21 09:47:44 -07:00
Alex Waygood
928f006318 typing.pyi: Improve comments for IO/TextIO (#8913)
#8726 proposed to make these properties abstract, but it would have broken half the typed-Python ecosystem, and we've since decided that it's not worth taking action on this (https://github.com/python/typeshed/issues/2146#event-7450564547). This PR rephrases the comments to make clear that there isn't really anything actionable that can be done here.
2022-10-17 12:44:40 +02:00
Shantanu
2969922b68 Fix intransitive subtyping issue with SupportsGetItem (#8785)
See https://github.com/python/mypy/issues/13713 for details
2022-09-23 13:25:15 -07:00
Nikita Sobolev
6e985ef3de stdlib mapping classes: Use better names for various pos-only parameters (#8637) 2022-08-28 23:29:00 +01:00