Commit Graph

5287 Commits

Author SHA1 Message Date
Oleg Höfling c661ac3ad6 importlib.abc: align input data types in InspectLoader.source_to_code builtin.compile inputs (#9852)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2023-03-08 13:43:05 +00:00
Alex Waygood 75ecd7e229 importlib.resources is a package on 3.11+ (#9822) 2023-03-08 08:36:18 +00:00
Lucina 81f2f22a03 Add deprecated to typing_extensions (#9850) 2023-03-06 11:24:36 -08:00
Alex Waygood 257e287fec Stdlib: correct many parameter names (#9815) 2023-03-04 09:53:12 +00:00
Thomas M Kehrenberg d76259a062 Add __name__ to _Wrapped in functools (#9835) 2023-03-03 15:02:51 +00:00
Alex Waygood 88506f0e56 _weakref.ReferenceType.__new__: all args are pos-only (#9820)
Fixes #9712
2023-02-27 13:20:10 +01:00
Eric Traut 9c4bfd5d11 Updated functools.wraps and functools.update_wrapper (#6670)
Updated functools.wraps and functools.update_wrapper to use ParamSpec to preserve signatures of wrapped and wrapper functions.
2023-02-26 12:41:08 +01:00
Rogdham db821101b8 bisect: don't require Sequences (#9813) 2023-02-25 09:24:31 -08:00
Stanislav Zmiev 806b13435c Add get_origin annotations (#9811)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-02-25 15:59:37 +00:00
Alex Waygood f6df5b5dd2 Remove a default value in distutils (#9800)
Fixes #9799.

Stubtest started failing on our `setuptools` stubs because of a default value added to our stdlib `distutils` stubs. The reason for this is because our `setuptools` stubs erroneously claim here that the `setuptools._distutils.core.Distribution` class is the same as the stdlib `distutils.dist.Distribution` class:

https://github.com/python/typeshed/blob/06755e10ba0d39e7e4c18fcc2663d9da564a71ad/stubs/setuptools/setuptools/_distutils/core.pyi#L3

In actual fact, they're not, and they have different default values for this parameter. But reverting the addition of the default value is the simplest short-term fix for now.

(An alternative fix would be to just merge #9795.)
2023-02-23 22:38:11 +00:00
Alex Waygood 1d2ae2598b Fix some typos in comments (#9802) 2023-02-23 22:11:24 +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 76bfe8b469 argparse: simplify parse_args overloads (#9798) 2023-02-22 23:46:35 +02:00
Alex Waygood b0dc6a3405 Add defaults to logging.LoggerAdapter methods (#9797) 2023-02-22 11:50:11 +01:00
Alex Waygood fbc092b4cd Stdlib: add defaults for several functions that delegate kwargs to other functions at runtime (#9791) 2023-02-21 23:31:25 -08:00
Alex Waygood fea57ad095 hmac.HMAC: digestmod defaults to None on py37 (#9790) 2023-02-21 18:24:34 +00:00
Alex Waygood f2ae3542d3 Stdlib: Deduplicate some multiprocessing type aliases (#9788) 2023-02-21 13:30:41 +01:00
Alex Waygood c407a44489 Add defaults to csv stubs (#9774) 2023-02-21 11:33:38 +01:00
Avasam a6c6bc1b8e Fix stdlib/disutils testing (#9734) 2023-02-21 08:06:20 +00:00
Alex Waygood bc847a9b07 Use generic NamedTuples to clean up urllib.parse (#9773) 2023-02-20 16:41:49 -08:00
Alex Waygood 4d99b33f84 Fix an unnecessary allowlist entry in ssl.pyi (#9776) 2023-02-20 16:35:38 -08:00
Alex Waygood 3786ab295e Fix an unnecessary socketserver allowlist entry (#9777) 2023-02-20 11:14:20 -08:00
Alex Waygood 0878173943 textwrap.{wrap, fill}: max_lines defaults to None (#9775)
All keyword arguments are delegated to `TextWrapper.__init__`: https://github.com/python/cpython/blob/59e86caca812fc993c5eb7dc8ccd1508ffccba86/Lib/textwrap.py#L373-L396
2023-02-20 10:39:48 -08:00
Alex Waygood 14ab089bd5 Use a generic NamedTuple for concurrent.futures.DoneAndNotDoneFutures (#9772) 2023-02-20 08:54:21 -08:00
Alex Waygood 4273a83bb7 unittest: Use a recursive type alias for assertIsInstance (#9770) 2023-02-20 15:35:50 +00:00
Alex Waygood 5e6b172e17 stdlib/_decimal.pyi: correct many parameter names (#9769) 2023-02-20 15:57:54 +01:00
Thomas M Kehrenberg 40d853cbe2 Add __set__ to functools.cached_property (#9762) 2023-02-20 12:36:45 +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
Avasam 3fc2f27990 Add missing types in xml.dom.minidom (#9731) 2023-02-19 21:49:00 +00:00
Andrew Svetlov 39fcd396ce lru_cache.cache_info().maxsize can be None for infinite cache size (#9763) 2023-02-19 16:50:19 +00:00
Alex Waygood 4ca0c48425 Improve the first overload of is_dataclass (#9758) 2023-02-19 06:26:11 -08:00
Nikita Sobolev 1387a9efa9 Mark threading.(R)Lock as final (#9753)
These are actually factory functions: https://github.com/python/cpython/blob/128379b8cdb88a6d3d7fed24df082c9a654b3fb8/Lib/threading.py#L108

The pure-Python version of `RLock` is, strictly-speaking, subclassable. But you're not *meant* to subclass `RLock`, even if you *can* with the pure-Python version: https://discuss.python.org/t/make-threading-lock-rlock-factory-functions-subclassable/24008/2
2023-02-19 12:21:55 +00:00
Shantanu da9366d016 Add frozen_default to dataclass_transform (#9756) 2023-02-18 15:25:29 -08:00
Spencer Brown f5b761d465 Add types for PIL.ImageTk (#9733) 2023-02-18 21:50:28 +02:00
Max Murin 5ebf892d07 Allow urlparse and urlsplit of bytes URLs (#9746) 2023-02-17 21:52:49 +01:00
Max Murin 75cd302215 dataclass: switch order of decorator overloads (#9743) 2023-02-16 16:22:56 -08:00
Shantanu 5c54e52e23 Fix default value of input, remove now unused allowlist entry for epoll (#9742) 2023-02-17 01:55:31 +02:00
Shantanu 58edfea33f email.parser: narrow io types (#9737) 2023-02-15 10:43:39 +01:00
Avasam 140bba3425 Add comments when subclassing Any (#9732) 2023-02-14 14:11:56 +01:00
Will Frey 48ef9eace8 Update xml.sax.parse to accept StrPath (#9708) 2023-02-13 17:51:47 +01:00
Avasam a768744d51 Type and mark as final module-level dunders not meant to be overwritten in stdlib/ (#9709) 2023-02-12 16:15:20 +00:00
PythonCoderAS 52cf716831 Make datetime classmethods return correct type (#9706) 2023-02-10 15:53:17 +00:00
Alex Waygood 9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood 32c575d980 subprocess.check_call: executable defaults to None (#9689)
This argument is forwarded on to `Popen.__init__`, like most of the other arguments. It can be `None`, just like the `executable` parameter for all the other `subprocess` functions:

```pycon
>>> import subprocess
>>> subprocess.check_call(["python", "-c", "1/1"], executable=None)
0
>>> subprocess.check_call(["python", "-c", "1/0"], executable=None)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\alexw\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', '-c', '1/0']' returned non-zero exit status 1.
```
2023-02-07 12:33:12 +00:00
Alex Waygood 53747b264e Stdlib: add 'obvious' default values (#9688) 2023-02-07 13:00:40 +01:00
Alex Waygood 0ef9c3f8e8 Enable flake8-pyi's Y037 (#9686) 2023-02-06 19:01:02 -08:00
Alex Waygood c4c4bee8aa Remove a no-longer-needed # noqa (#9685) 2023-02-07 00:43:53 +00:00
Alex Waygood efee70abfa Bump mypy to 1.0 (#9684) 2023-02-06 15:57:17 -08:00
Nikita Sobolev f7cb7f33b2 Use OSError instead of IOError (#9683) 2023-02-06 18:56:32 +00:00