Commit Graph

5068 Commits

Author SHA1 Message Date
Jason Rensburger
9641c6c9cc weakref.WeakMethod callback arg type (#10197)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-29 06:31:56 -07: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
Ali Hamdan
56aeeb677f Fix groups type in argparse.HelpFormatter (#10226) 2023-05-27 14:44:04 +02:00
Alex Waygood
a4856c5650 shutil.rmtree: Add onexc parameter; add parameter defaults (#10219) 2023-05-25 23:38:21 -07:00
Shantanu
cf6fb07f2f math: updates for py312 (#10213) 2023-05-25 20:21:40 +01:00
Shantanu
b7d927a53f random: update for py312 (#10214)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-25 18:49:51 +01:00
Shantanu
9a0d1e9bb9 statistics: update for py312 (#10217)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-25 18:48:01 +01: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
Shantanu
7994f165da json: add AttrDict in py312 (#10212) 2023-05-25 13:31:30 +01:00
Shantanu
854c453910 fractions: remove _normalize, update for py312 (#10218) 2023-05-25 10:21:19 +01:00
Shantanu
a4e33d4053 shutil.unpack_archive: update for py312 (#10215)
Add the new "filter" parameter
2023-05-25 09:53:25 +01:00
Shantanu
1eeab77254 Update VERSIONS for the death of smptd (#10210) 2023-05-25 09:49:18 +01:00
Nikita Korolev
7ffb7cef69 SysLogHandler facility could be a string (#10206)
It is possible to pass syslog facility as string to __init__ too
2023-05-24 19:46:37 -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
Nikita Sobolev
e666602d14 asyncore and asynchat will be removed in 3.12 (#9033) 2023-05-23 19:16:25 +02:00
Ali Hamdan
ca701f0ef3 Type argparse.HelpFormatter._Section (#10191)
The python type system doesn't provide a way to fully express the type of
`self.NestedClass` with inheritance but this change is still an improvement
over the `Any` annotations. The usage of `_Section` is rare and subclassing
it is even rarer so this shouldn't cause trouble.
2023-05-22 07:39:46 -07:00
Nikita Sobolev
f7d7bb53ca Change asyncio.Task.__init__ signature for Python 3.12 (#10184) 2023-05-15 13:34:45 +02:00
Nikita Sobolev
b25a5b6aef Use _AwaitableLike in EventLoop.run_until_complete (#10181) 2023-05-15 09:34:50 +01:00
Nikita Sobolev
15a0c28530 Use _CoroutineLike in asyncio.taskgroups (#10180) 2023-05-14 13:32:27 +01:00
Nikita Sobolev
1d8a199582 [asyncio] Make create_task work with coroutines only in 3.12 (#10177)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-14 12:16:26 +01:00
Sam Bull
9c212cdf5c Update _SSLProtocolTransport._ssl_protocol (#10176)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-12 17:56:58 -07:00
Alex Waygood
d1bfd08b4b Allow passing multiprocessing.Queues to QueueListener/QueueHandler (#10169) 2023-05-10 17:06:41 +02:00
Jun Komoda
9457de310a update constructor args of the CFuncPtr to expand acceptable types (#10155)
* allow the second element of `_PF` to be `None`

* allow `__paramflags` to be `None`

* allow `__iid` to be `None` or `_CData`

* remove unused symbols
2023-05-07 07:32:58 -07:00
Jun Komoda
1d69fb3675 fix _ctypes.CFuncPtr constructor args (#10154)
* add a conditional branch for Windows only

* fix argname spelling
`vtlb_index` -> `vtbl_index`

* add an overload
for the case where no arguments are passed to the constructor

* mark all of the arguments as positional-only
2023-05-06 20:04:16 -07:00
Jun Komoda
a6ecf564b5 move and rename from ctypes._FuncPointer to _ctypes.CFuncPtr (#10140)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-06 10:17:34 -07:00
Jun Komoda
05c0a1d8b2 move byref-related definitions from ctypes/__init__.pyi to _ctypes.pyi (#10137) 2023-05-03 16:50:47 +01:00
Sebastian Rittau
81f6beda9e Document sys.std* typing (#10135) 2023-05-03 16:30:37 +02:00
Jun Komoda
01b09d4371 Move some pointer-related definitions from ctypes/__init__.pyi to _ctypes.pyi (#10133) 2023-05-03 10:04:13 +01:00
Jun Komoda
ce531f897f move some non-pointer-related definitions from ctypes/__init__.pyi to _ctypes.pyi (#10130)
- `ArgumentError`
- `addressof`
- `alignment`
- `get_errno`
- `resize`
- `set_errno`
- `sizeof`
2023-05-02 16:54:42 +01:00
Jun Komoda
bbeec7cbbf Move some Windows-specific things from ctypes/__init__.pyi to _ctypes.pyi (#10128)
- `FormatError`
- `get_last_error`
- `set_last_error`
2023-05-02 11:21:55 +01:00
Alex Waygood
e816acffdd Avoid unnecessary forward refs in class definitions (#10124) 2023-05-01 07:50:50 -07:00
Alex Waygood
277532219f Remove unnecessary F821 noqas (#10123) 2023-05-01 07:50:00 -07:00
Jun Komoda
295a5c3e7a Move Structure and Union from ctypes/__init__.pyi to _ctypes.pyi (#10125) 2023-05-01 13:01:41 +01:00
Jun Komoda
ae0c9f9dad Move _SimpleCData and Array from ctypes/__init__.pyi to _ctypes.pyi (#10118) 2023-04-30 21:22:46 +01:00
Alex Waygood
2c3449694b Run mypy and pyright on our py312 stubs in CI (#10119) 2023-04-30 15:31:08 +01:00
Jelle Zijlstra
40975222b4 multiprocessing: Queue does not inherit from queues.Queue (#10104)
Fixes #3404
2023-04-29 15:39:11 +01:00
Avasam
fb4bf034f3 Add fixers to lib2to3 (#10003) 2023-04-27 21:56:56 -07:00
Tomas R
a7748a9dd1 Add missing stubs for logging.config (#10055)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-04-27 07:57:46 -07:00
Christian Bundy
b4ad214754 Add object.__getstate__() in Python 3.11+ (#10091) 2023-04-27 05:05:54 -07:00
Nikita Sobolev
1d9f35369d functools: Add cache_parameters method to _lru_cache_wrapper (#10076)
The docs says that `cache_parameters()` function was added in 3.9: https://docs.python.org/3/library/functools.html#functools.lru_cache
Source: af53046995/Lib/functools.py (L512)
But, `typeshed` does not have it.
2023-04-24 07:29:54 -07:00
Nikita Sobolev
cd3f52ac14 Simplify logging.config type imports (#10077) 2023-04-24 14:41:10 +03:00
James Hilton-Balfe
acfde4e40b Add stubs for types.get_original_bases (#10073)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-04-23 22:13:43 +01:00
Wesley Collin Wright
cedf3b5684 stdlib/xml: fix return types for toxml/toprettyxml methods (#10061) 2023-04-22 16:36:57 -06:00
Akuli
03b8c60a02 Support dict(foo.split() for foo in bar) with bytes (#10072) 2023-04-22 18:28:34 +03:00
Lucina
41b8981368 unittest.mock.__version__ was removed in 3.9 (#10056)
See the first entry in https://docs.python.org/3/whatsnew/3.9.html#removed
2023-04-17 11:51:34 -06:00
Victor Westerhuis
8db375c3a9 Fix target argument of pathlib.Path.{sym,hard}link_to (#10019) 2023-04-13 13:42:26 +02:00
Sebastian Rittau
be0ef21167 [zipfile] Move protocol behind version gate (#10036)
This protocol is only used for our Python 3.8 stubs. Therefore it's best to limit its availability as much as
possible.
2023-04-12 15:07:49 +01:00