Commit Graph

271 Commits

Author SHA1 Message Date
Marc Mueller
6dda799d8a Add type ignores for mypy 1.11 (#12177) 2024-06-20 15:49:50 +01:00
Alex Waygood
fc33ba67ba builtins: updates for py313 (#12028) 2024-05-24 15:27:15 -04:00
Alex Waygood
4bc70e1e4d Use mypy from git for stdlib stubtest (#12016) 2024-05-23 13:08:18 -04:00
funkyrailroad
d75a47c2b7 Update BaseException and BaseExceptionGroup for 3.13 (#12010) 2024-05-23 10:44:41 -04:00
Shantanu
bb267c82f8 builtins: eval and exec can take globals and locals via keyword (#11934) 2024-05-17 23:55:16 +02:00
Sebastian Rittau
ef0a5c2d12 Replace types._Cell with types.CellType (#11904)
Closes #11901
2024-05-12 06:38:38 -07:00
Jelle Zijlstra
1dff589dd4 Use TypeIs for various stdlib functions (#11823) 2024-04-26 16:43:19 -07:00
Alex Waygood
d0f2be92ab Bump pyright to v1.1.360 (#11810) 2024-04-24 14:09:16 +02:00
Jay Qi
cc5f23ac14 Add init to NameError stub with name keyword argument (#11627)
Co-authored-by: Jay Qi <jayqi@users.noreply.github.com>

Closes #11626
2024-03-18 12:08:25 -06: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
Avasam
2116158891 Remove old type-ignore explanation comments not removed in #8280 (#11513) 2024-03-01 07:10:10 -08:00
Nikita Sobolev
675ab38ab7 Update pyright version to 1.1.350 (#11501)
If you're reading about this commit in an auto-generated changelog: this is an internal change that should have no impact on how these stubs are understood by static-analysis tools such as type checkers or IDEs
2024-02-29 10:14:39 +00:00
Nikita Sobolev
19d1b686b6 str.count only takes positional args (#11503)
```
>>> ''.count(x='a')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: str.count() takes no keyword arguments
```
2024-02-29 10:37:12 +03:00
plokmijnuhby
c5c2c14db9 builtins: Fix typing of reversed (#10655) 2024-02-16 06:52:58 -08:00
shz42
2168ab5ff4 Add tuple key type for memoryview.__getitem__ and __setitem__ (#11296) 2024-01-21 05:14:34 +01:00
Alex Waygood
ccc81f224d Bump various test dependencies (#11249) 2024-01-05 14:09:02 -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
Shantanu
6fcd37456d Move ellipsis definition to types (#11223) 2024-01-02 16:14:53 -08:00
Simon Lanzmich
fe48f37bf7 stdlib: Annotate type.__prepare__ to return a mutable object (#11093)
During class creation, the namespace returned by `__prepare__` is
populated when the class body is executed. Therefore, it must be
mutable.
2023-12-03 22:46:33 +00:00
Alex Waygood
10febc4fe0 stdlib: remove unused type: ignore comments (#11061) 2023-11-23 14:00:07 +01:00
Jelle Zijlstra
c2c8d7cf5d stdlib: Apply some simple deprecations (#11044) 2023-11-23 09:03:01 +01:00
Xuehai Pan
aa15fafc33 stdlib: builtins.type.__base__ can be None (#11040) 2023-11-18 14:03:56 +00:00
Jelle Zijlstra
4deef7550f stdlib: Fix more signatures with unrepresentable defaults (#11007) 2023-11-09 18:20:09 -08:00
Jelle Zijlstra
d9311f946e stdlib: fix signatures for some functions with unrepresentable defaults (#11000)
Found with python/mypy#16433

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-09 08:14:36 -08:00
Sebastian Rittau
a5c1a4cd3f Introduce _typeshed.SupportsFlush (#10983) 2023-11-06 15:31:02 +01:00
Alex Waygood
a08d4c8d2e Remove many redundant inheritances from Generic[] (#10933) 2023-10-26 20:07:20 +02:00
Nikita Sobolev
5c775a3502 Improve int.__pow__ and float.__pow__ comments (#10925)
It used to be `__x`. Now, it is not clear what `x` is in this context.
2023-10-25 10:15:34 +01:00
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