Sebastian Rittau
3a036b64fc
logging: Remove hack obsoleted by PEP 655 (#11078 )
2023-11-30 21:48:54 +00:00
Rayan Sóstenes
9fbf2e1c0c
Fix: functools.reduce does not accept keyword arguments ( #11090 )
2023-11-30 13:44:52 +00: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
Paul J. Dorn
1d3a18c6da
asyncio: create_subprocess_exec is the same as create_subprocess_shell, except where it isn't ( #11076 )
...
asyncio.subprocess: duplicate _shell args to _exec
Fixes: 38dfb57adf
Expanding the keywords used True arguments for shell in both _exec and _shell. The _exec one is for shell=False. With the text argument, its the other way around: both demand Falsy here, so match those lines.
2023-11-29 16:11:03 +00:00
Alex Waygood
09668963a1
Make itertools.starmap covariant ( #11037 )
2023-11-29 11:10:26 +00:00
Jit Kanetkar
e2a393897c
shutil.pyi: update chown stubs to support file descriptor ( #11082 )
...
Per the python docs, `os.chown`, which is directly called by `shutil.chown`, supports "specifying a file descriptor". Currently, this below code works but fails in mypy:
```python
import shutil
import tempfile
with tempfile.TemporaryFile() as file:
shutil.chown(file.fileno(), group="my_group")
```
2023-11-28 22:22:33 +00:00
Alex Waygood
9bbfa3362a
Add importlib.machinery.NamespaceLoader ( #11074 )
2023-11-28 20:02:24 +00:00
Anthony Sottile
53592e421a
set root for logging dict config to be non-None ( #11077 )
2023-11-28 20:21:19 +01:00
Serious-senpai
b1d5f2f8d5
Provide precise type hints for combinations_with_replacement ( #11068 )
2023-11-24 17:46:39 +00:00
Alex Waygood
01432805d9
Fix typos in docs and comments ( #11064 )
2023-11-23 14:55:58 +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
Allison Karlitskaya
53d5ee5a78
stdlib: HTTPSConnection(port=) is int|None ( #11058 )
...
Fix an apparent typo in the type of this field.
Closes #11057
2023-11-22 17:20:33 +00:00
Nikita Sobolev
06d0151b25
Enable redundant-self mypy error code ( #11056 )
2023-11-22 10:13:17 +00:00
Alex Waygood
83964a4dc5
stdlib: add many missing __del__ methods ( #11042 )
2023-11-18 11:32:12 -08:00
Xuehai Pan
aa15fafc33
stdlib: builtins.type.__base__ can be None ( #11040 )
2023-11-18 14:03:56 +00:00
Nikita Sobolev
62ccb32b22
Mark deprecated methods as deprecated in wave module ( #11001 )
2023-11-17 07:31:00 -08:00
Alex Waygood
4982061ab3
Make itertools.groupby covariant ( #11032 )
2023-11-17 12:33:14 +01:00
Jens Tröger
590f89b594
logging: Add a _FilterProtocol type to Filterer.addFilter() filter argument. ( #11018 )
2023-11-14 11:14:19 +02:00
Serious-senpai
676446569d
Provide more precise type hints for itertools.permutations ( #11019 )
2023-11-11 14:23:11 +00:00
Alex Waygood
eebc28740e
Revert "Use Callable[..., Any] instead of Callable[..., object] in unittest" ( #8779 )
2023-11-10 19:53:33 +01:00
Akuli
cad0c04ec0
tkinter: Require passing in a callback function to .after() ( #11013 )
2023-11-10 20:18:25 +02:00
Rob Percival
cc0b41a994
Fix type hints for unittest.util.unorderable_list_difference() ( #11012 )
...
Fix type hints for unorderable_list_difference()
It claimed that the arguments were `Sequence` types (immutable), but the function removes elements from them, so they must be `MutableSequence` types. Specifically, it calls `pop()` on the first argument and `remove()` on the second argument.
See the function implementation for details:
0b06d2482d/Lib/unittest/util.py (L98-L113)
2023-11-10 17:53:03 +00:00
Akuli
99563a2e6e
Use @deprecated in tkinter.Variable tracing methods ( #11011 )
2023-11-10 19:38:20 +02: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
Jakob Stadler
d6403b14aa
stdlib: Fix os.startfile ( #10996 )
...
Fixes #10991
2023-11-08 15:44:14 -08:00
Jelle Zijlstra
17f8a82376
ast: mark ast.Num etc. as deprecated ( #10994 )
2023-11-08 19:40:22 +01:00
Alex Waygood
516f665505
Bump flake8-pyi to 23.11.0 ( #10997 )
2023-11-08 16:01:24 +00:00
Jelle Zijlstra
b36f3c5229
asyncio: remove overly specific protocols ( #10984 )
...
The _warn parameter to these methods is just there to work around
some finalization issues and should never be used by users. In
addition, these protocols are out of date (the "stacklevel" argument
is not used by current CPython main). I don't think we gain anything
by trying to maintain these protocol definitions.
2023-11-07 19:26:25 -08:00
Thomas M Kehrenberg
359d4c095d
Fix return type of dbm.whichdb ( #10989 )
...
It is `None` if the given file doesn't exist or isn't a database.
2023-11-07 12:49:39 +01:00
Jelle Zijlstra
3229b36644
stdlib: More pos-only parameters to Protocols ( #10987 )
2023-11-06 23:45:12 +01:00
Jelle Zijlstra
5030b7419b
stdlib: Use pos-only parameters for many Protocols ( #10985 )
2023-11-06 18:09:04 +01:00
Sebastian Rittau
a5c1a4cd3f
Introduce _typeshed.SupportsFlush ( #10983 )
2023-11-06 15:31:02 +01:00
Andrey Rakhmatullin
7b18a0be91
Fix type hint for xml.sax.saxutils.XMLGenerator.__init__(). ( #10979 )
...
The `out` parameter accepts objects with `write(__o: bytes)`, not `write(__o: str)` methods.
2023-11-06 14:31:50 +01:00
Alex Waygood
8023ba764a
Remove redundant inheritances from Generic and various typing protocols ( #10981 )
2023-11-06 14:00:25 +01:00
Tin Tvrtković
c8073493fc
http.HTTPConnection.putheader tweak ( #10978 )
2023-11-05 15:38:41 -08:00
Avasam
3a56e0034c
xml.etree: Fix tag param in __init__ ( #10968 )
2023-11-03 14:50:49 +01:00
Serious-senpai
fa088948aa
Fix incorrect typehint for callbacks in multiprocessing.Pool ( #10949 )
2023-11-02 16:59:29 +01:00
Spencer Brown
3c872ca8fd
Add types to some tkinter.Text methods. ( #10946 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2023-10-31 18:44:39 +02:00
Benedikt Radtke
1196915b39
fix nullability of scrypt params ( #10942 )
2023-10-29 01:35:39 +02:00
Alex Waygood
56288ad2d0
Add stubs for importlib.(resources.)simple ( #10931 )
2023-10-28 07:29:57 -07:00
Avasam
49ba409da8
Replace isort with Ruff ( #10912 )
2023-10-27 20:14:38 -07:00
Alex Waygood
77bccbe1f1
sys.monitoring.restart_events() is no longer undocumented (#10938 )
...
Following 3f84a19e62
2023-10-27 17:14:54 +01:00
Sebastian Rittau
1c184fea33
Simplify Traversable signature ( #10934 )
...
Simplify Traversable.open() signature. This is necessary so that implentors can
reasonanbly implement this method. For example `zipfile.Path.open()` (which
is considered a `Traversable`) only supports this subset.
Make `Traversable.__truediv__` and `joinpath` arguments pos-only. The
arguments are named differently in both `pathlib.Path` and `zipfile.Path`.
2023-10-27 00:50:11 +02:00
Alex Waygood
a08d4c8d2e
Remove many redundant inheritances from Generic[] ( #10933 )
2023-10-26 20:07:20 +02:00
Alex Waygood
5dbdd59c9b
Add io.text_encoding on py310+ ( #10929 )
...
See https://discuss.python.org/t/type-checkers-complain-about-io-text-encoding/37187/1 for discussion. The function is documented, even though it's not included in `io.__all__` (which is why stubtest hasn't been complaining about it being missing): https://docs.python.org/3/library/io.html#io.text_encoding
2023-10-26 10:41:31 -07:00
Alex Waygood
908993a807
Add stubs for importlib.(resources.)readers ( #10928 )
...
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
2023-10-26 14:18:55 +01:00
Aditya Paul
2ce9dcd5fb
Allow str for tkinter.Scrollbar.set() ( #10926 )
2023-10-25 20:48:08 +03:00