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 and GitHub
2d146e7da2
Use PEP 570 syntax in comments ( #11552 )
2024-03-09 15:06:25 -08:00
Shantanu and GitHub
470a13ab09
Use PEP 570 syntax in stdlib ( #11250 )
2024-03-09 14:50:16 -08:00
4d8ae17776
Bump mypy to 1.9, add to json.encoder, small fixups ( #11549 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2024-03-09 14:25:00 -08:00
Jelle Zijlstra and GitHub
5b1fd121e0
asyncio: Fix type of add_child_handler callback ( #11548 )
2024-03-09 17:02:05 +01:00
layday and GitHub
ca1e47739e
Fix type of concurrent.futures.wait for Python <= 3.8 ( #11537 )
...
Closes #11533 .
2024-03-07 20:08:37 +01:00
Avasam and GitHub
2116158891
Remove old type-ignore explanation comments not removed in #8280 ( #11513 )
2024-03-01 07:10:10 -08:00
Akuli and GitHub
0ad004a776
tkinter: Simplify wm_iconphoto() ( #11508 )
2024-02-29 13:45:45 +02:00
Nikita Sobolev and GitHub
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 and GitHub
7b4c751abb
Fix pos-only params in tkinter module ( #11506 )
2024-02-29 09:02:02 +00:00
Nikita Sobolev and GitHub
217166b8a9
Fix pos-only params in os module ( #11505 )
2024-02-29 09:01:43 +00:00
Nikita Sobolev and GitHub
fa4ca40f5c
Fix _operator.attrgetter pos-only params ( #11504 )
...
There cannot be any keywords:
```c
static PyObject *
attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
attrgetterobject *ag;
PyObject *attr;
Py_ssize_t nattrs, idx, char_idx;
if (!_PyArg_NoKeywords("attrgetter", kwds))
return NULL;
// ...
```
2024-02-29 11:03:36 +03:00
555c1fe223
stdlib: Add Shutdown error and shutdown method to queue module ( #11489 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2024-02-29 07:45:15 +00:00
Nikita Sobolev and GitHub
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
Thanos and GitHub
2e2c6fca8b
Update sqlite/dbapi2.pyi to include new autocommit parameters for 3.12+. ( #11485 )
2024-02-28 05:29:31 -08:00
Victorien and GitHub
91f224a293
Add @deprecated to abstractclass/staticmethod/property ( #11488 )
2024-02-28 13:12:06 +00:00
Jelle Zijlstra and GitHub
c62fedc190
tarfile: Remove @deprecated ( #11476 )
...
Fixes #11472 .
As noted in the issue, it is possible to set the filter on the class, but that will still cause type checkers to show deprecation warnings. Therefore, we unfortunately cannot enforce this deprecation in the type system.
2024-02-27 06:34:26 -08:00
Kanishk Pachauri and GitHub
1e7e174b4f
stdlib: fix ctypes errcheck type ( #11467 )
2024-02-26 14:47:46 +01:00
Amin Alaee and GitHub
9916efae63
Update os. EX_NOTFOUND not available in Linux ( #11461 )
2024-02-26 09:36:33 +01:00
Kanishk Pachauri and GitHub
49b1a1a96a
stdlib: Use Literal in difflib.SequenceMatcher.get_opcodes ( #11464 )
2024-02-23 07:44:29 -08:00
Avasam and GitHub
3c08a97656
Improve typing of sysconfig.get_config_var(s) ( #11454 )
2024-02-22 09:52:41 -08:00
Randolf Scholz and GitHub
601587e71d
changed overload order for date.__sub__ and datetime.__sub__ ( #10999 )
2024-02-19 13:11:29 +01:00
Sebastian Rittau and GitHub
df409a2fb5
Use a protocol for shlex.instream et al. ( #11452 )
2024-02-18 22:04:43 -08:00
Avasam and GitHub
bb6613f379
shlex.split: allow TextIO and deprecate None (#11451 )
2024-02-19 06:10:01 +01:00
84572bbfe6
importlib.metadata: Use the SimplePath protocol ( #11445 )
...
Closes #9217 . Followup from #11436 .
This mostly makes a simpler set of changes than #9217 ; in particular
it does not make PathDistribution generic. I think this is in line with
how the protocol is supposed to be used, though not always in line with
the runtime type annotations (which don't all make sense).
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
2024-02-18 21:05:33 -08:00
Ali Hamdan and GitHub
6df52a7b39
Improve typing of start_new_thread when called without kwargs ( #11446 )
2024-02-19 05:39:18 +01:00
bba8cbd6f8
stdlib: more deprecations ( #11009 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2024-02-18 06:50:29 -08:00
Jelle Zijlstra and GitHub
705744af4c
Update for typing_extensions 4.10 ( #11438 )
2024-02-18 00:59:48 -08:00
e5d25a7605
importlib.metadata: Improve and test SimplePath protocol ( #11436 )
...
Co-authored-by: layday <layday@protonmail.com >
2024-02-18 00:36:01 -08:00
Nikita Sobolev and GitHub
e961db9492
Change the asyncio.Task constructor type ( #10228 )
2024-02-17 15:50:26 -08:00
863d22a239
Make return type of functools.cache_property covariant ( #10053 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2024-02-17 15:38:46 -08:00
Akuli and GitHub
d5ff34e049
Add types to tkinter.Canvas.scale() ( #11369 )
2024-02-16 21:10:14 -08:00
764532356a
add _lsprof module ( #11159 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2024-02-16 08:38:49 -08:00
winestone and GitHub
f3c7c48438
itertools: Improve precision of itertools.product types when called with 7 or more arguments ( #11163 )
2024-02-16 07:03:13 -08:00
plokmijnuhby and GitHub
c5c2c14db9
builtins: Fix typing of reversed ( #10655 )
2024-02-16 06:52:58 -08:00
Alex Waygood and GitHub
7c3cb9971d
Further improve return types in the numbers module ( #11375 )
2024-02-15 21:04:25 -08:00
Sebastian Rittau and GitHub
4664986cea
Turn TextIOWrapper(buffer) into a protocol ( #11420 )
2024-02-14 19:49:28 +01:00
Watal M. Iwasaki and GitHub
a3d356c04c
ftplib: Correct timeout option to float | None ( #11419 )
2024-02-14 10:25:48 +00:00
Akuli and GitHub
41245698e0
Delete a few simple type aliases in tkinter ( #11415 )
2024-02-13 11:37:32 +01:00
b44d22e81d
Use bool | Literal[0, 1] instead of int in some tkinter bool parameters ( #11412 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-13 02:06:00 +02:00
Riley Miļeško and GitHub
5382d24d1d
Fix return type of calendar.HTMLCalendar.formatyearpage ( #11413 )
2024-02-12 22:50:32 +00:00
4585c714d9
Add annotations and defaults for tkinter.ttk.OptionMenu ( #11404 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2024-02-12 21:33:42 +02:00
Marcell Perger and GitHub
13aed8a1c2
Add defaults for tkinter.ttk __init__ methods ( #11405 )
...
NOTE: I've ignored things marked as undocumented or where the type of the default didn't match the annotation.
2024-02-12 12:54:12 +02:00
Marcell Perger and GitHub
49d5827141
Add annotations for tkinter.ttk.LabeledScale ( #11402 )
2024-02-11 20:05:27 +02:00
Mike Zimin and GitHub
a773d3f6e7
unicodedata.pyi: Add normalization form literal ( #11390 )
2024-02-11 16:20:52 +01:00
Marcell Perger and GitHub
5eb040b1e6
Fix tkinter.ttk's compound argument ( #11393 )
...
Allow the empty string (`""`).
2024-02-10 20:55:08 +02:00
Marcell Perger and GitHub
187928d8ce
Add defaults for tkinter __init__ methods ( #11391 )
...
Add defaults for `tkinter`'s `__init__` methods, see #10947
Some notes about specific arguments:
- `variable` and `textvariable`: The default value (using `dict`) is consistently `""` but this doesn't match the annotated `Variable` type so I didn't fill these in
- `Message(padx, pady)`: The default value is `-1` which is not allowed according to the documentation so I didn't fill this in
- `Toplevel(use)`: The default value is always `""` but this doesn't match the annotated `int` type so I didn't fill this in
2024-02-10 20:51:27 +02:00
Alex Waygood and GitHub
15cdc20744
Fix stdlib stubtest for Python 3.11.8 and 3.12.2 ( #11384 )
...
Fix stubtest for Python 3.11.8 and 3.12.2
2024-02-09 02:28:03 -08:00
Ran Benita and GitHub
a4f81a67a0
sys: add last_exc on Python>=3.12 ( #11378 )
...
https://docs.python.org/3/library/sys.html#sys.last_exc
2024-02-07 20:37:48 +00:00
M Bussonnier and GitHub
edf41ae5e2
Update type of Formatter.convert_field (missing |None) ( #11377 )
...
From the source it expects that the second parameter (conversion), can
be None:
```python
def convert_field(self, value, conversion):
# do any conversion on the resulting object
if conversion is None:
return value
...
```
Since at least 17 years according to git blame, as None is refered as
early as 11529195cae2438a3ac003babcb1b11af67c4037
And still present in main branch:
https://github.com/python/cpython/blob/ef3ceab09d2d0959c343c662461123d5b0e0b64b/Lib/string.py
2024-02-07 19:24:21 +00:00