Commit Graph

242 Commits

Author SHA1 Message Date
plokmijnuhby
cec86eb22e Replace __init__ with __new__ in builtins and types (#10761) 2023-09-25 14:12:23 +02:00
plokmijnuhby
41bfc12065 Add a case where zip() can be called with no arguments (#10648) 2023-09-22 20:00:08 -07:00
Ali Hamdan
2b323bed50 Add typeshed aliases to the types accepted by int and float constructors (#10707)
Ref https://github.com/python/typeshed/pull/10630#discussion_r1321646168
2023-09-22 19:50:43 -07:00
Randolf Scholz
6bf23949b5 types.EllipsisType was added in Python 3.10 (#10719) 2023-09-17 00:50:33 +02: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
1088ab3d93 Improve stubs for classmethod and staticmethod (#10421) 2023-07-19 13:32:04 +02: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
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
Alex Waygood
1b2e4091db Bump mypy to 1.4.1 (#10351) 2023-06-25 16:45:09 -07:00
Shantanu
7df870f452 Run stubtest for Python 3.12 (#10253) 2023-06-04 05:53:03 -07:00
Shantanu
be85cc7121 builtins: updates for py312 (#10211)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-06-04 01:05:40 +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
Jelle Zijlstra
c0a0c34020 Use PEP 688 (#10225)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-27 19:55:30 -07:00
Christian Bundy
b4ad214754 Add object.__getstate__() in Python 3.11+ (#10091) 2023-04-27 05:05:54 -07:00
Akuli
03b8c60a02 Support dict(foo.split() for foo in bar) with bytes (#10072) 2023-04-22 18:28:34 +03:00
Alex Waygood
dd2818a41d Stdlib: add container default values (#9909) 2023-03-21 09:12:34 +01:00
Alex Waygood
28dd6c1a2e Use ParamSpec for classmethod and staticmethod (#9771) 2023-03-14 09:59:17 +00:00
Alex Waygood
257e287fec Stdlib: correct many parameter names (#9815) 2023-03-04 09:53:12 +00:00
Alex Waygood
6ba28ae547 Remove unused type: ignore comments (#9801) 2023-02-23 12:59:50 -08:00
Neil Girdhar
06755e10ba Add object.__subclasshook__ (#9755) 2023-02-22 23:08:25 +00:00
Alex Waygood
4273a83bb7 unittest: Use a recursive type alias for assertIsInstance (#9770) 2023-02-20 15:35:50 +00:00
Alex Waygood
c5b5dd4bf4 Various stdlib dunders: correct parameter names; improve types; add defaults (#9761)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-02-19 22:44:20 +00:00
Shantanu
5c54e52e23 Fix default value of input, remove now unused allowlist entry for epoll (#9742) 2023-02-17 01:55:31 +02: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
1e3d762a12 stdlib: use bool for annotations where the default is False (#9672) 2023-02-04 11:58:18 +00:00
Alex Waygood
100cd62373 stdlib: Add bytes defaults (#9660) 2023-02-02 16:01:54 -08:00
Alex Waygood
1d7dda7fa1 stdlib: Add defaults for positional-only parameters (#9655) 2023-02-01 21:44:08 +00:00
Alex Waygood
8000fbd386 Bump various test dependencies (#9646) 2023-02-01 06:23:40 -08:00
Alex Waygood
a6919227be Add several version-dependent default values to parameters in the stdlib (#9631) 2023-01-31 01:21:39 +00:00
Alex Waygood
9099403d58 builtins.pow: Add default values to <py38 branches; remove incorrect = ...s for the 13th overload (#9610) 2023-01-30 18:12:50 +01: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
Jelle Zijlstra
af2ce282d5 builtins: do the TODO on compile() (#9567) 2023-01-18 11:48:48 -08:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Avasam
c70d303985 Audit stdlib object annotations (#9519) 2023-01-17 15:40:00 +00:00
Alex Waygood
597e1a0078 Bump various test dependencies (#9549) 2023-01-16 11:04:45 -08:00
Avasam
aad1a14890 Use the FileDescriptorOrPath alias consistently in the stdlib (#9513) 2023-01-12 18:14:48 +00:00
Nikita Sobolev
6f6dad117d compile can only work with ast.Module | ast.Expression | ast.Interactive (#9424) 2022-12-29 11:25:07 +01:00
Avasam
23ac9bff19 Check for unused pyright: ignore and differentiate from mypy ignores (#9397) 2022-12-28 10:44:29 +00:00
Nikita Sobolev
ae58142e6e Fix typings of ExceptionGroup and BaseExceptionGroup (#9230)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2022-11-22 20:46:03 -08:00
Nikita Sobolev
70c4af4b73 Refactor round and add tests (#9151)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-11-11 18:19:51 +00:00
Alex Waygood
068b0b488a Improve builtins.vars() (#9146) 2022-11-10 12:14:05 +01:00
Alex Waygood
739460291b Use recursive type aliases in builtins and _typeshed (#9134) 2022-11-08 17:04:09 +00:00
Jelle Zijlstra
c347c29417 builtins: improve bytes handling (#9027) 2022-10-30 17:32:07 -07:00
LeeeeT
cf9bdc2d98 Make the first argument of float.__new__ positional-only (#8991)
Closes #8990
2022-10-26 15:42:17 -07:00
Nikita Sobolev
5bbba5d008 Collection is Sized (#8977) 2022-10-25 06:08:28 -07:00
Jelle Zijlstra
1b04ef2673 bytes, bytearray constructors: support buffers (#8924) 2022-10-18 19:20:20 +01:00