Commit Graph

126 Commits

Author SHA1 Message Date
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
Shantanu
93ee41bcd9 typing: add _type_repr (#8624) 2022-08-26 12:15:11 +02:00
Aron Bierbaum
ef6bacab92 Update ForwardRef._evaluate for Python 3.11 (#8600)
recursive_guard argument was added in https://github.com/python/cpython/pull/21553
2022-08-23 18:05:55 -07:00
Alex Waygood
2c052651e9 Normalise use of Never vs NoReturn (#8549) 2022-08-17 21:53:40 +01:00
Alex Waygood
cf0b3a2596 Improve .keys(), .values(), .items() methods for TypedDicts (#8532) 2022-08-12 20:02:43 -07:00
Alex Waygood
556f6a10f6 Enable flake8-pyi's Y034 check in stdlib/typing.pyi (#8530) 2022-08-11 10:57:31 +02:00
Alex Waygood
7eaedd44dd Add missing TypedDict methods and ClassVars (#8512) 2022-08-10 10:29:40 +01:00
Nikita Sobolev
64bc0590a6 Remove un-needed __hash__ methods from stdlib (#8465) 2022-08-06 14:55:27 +01:00
Alex Waygood
ea7bbbdad7 Move Match and Pattern to re.pyi; move ContextManager protocols to contextlib.pyi (#8447) 2022-07-31 15:27:47 +02:00
Sebastian Rittau
91fd79c158 Updates for Python 3.11.0b4 (#8288) 2022-07-13 13:10:20 +02:00
Sebastian Rittau
faae950ade Use error codes for type ignores (#8280)
Disable reportSelfClsParameterName for pytype as this is out of typeshed's
control

Closes: #7497
2022-07-12 20:15:49 +02:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
KotlinIsland
35a59f6aa7 typing.AwaitableGenerator: add type_check_only (#8115) 2022-06-20 21:01:09 -07:00
Alex Waygood
1be5918baa Use _typeshed.IdentityFunction more consistently (#8063) 2022-06-12 16:56:14 -07:00
Alex Waygood
e7a5b7a762 Fix various __all__-related errors and omissions (#8031) 2022-06-07 23:29:55 +01:00
Sebastian Rittau
214bf15dce Use "all +=" instead of duplicating the branches (#7865) 2022-06-07 13:32:19 +02:00
Jelle Zijlstra
c8a978f756 typing: Add dataclass_transform (#7690)
python/cpython#91861
2022-04-25 22:06:32 -06:00