Commit Graph

4803 Commits

Author SHA1 Message Date
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
Nikita Sobolev
c96079f0df urllib.HTTPError.headers is a settable property (#9682) 2023-02-06 18:56:08 +00:00
Alex Waygood
5157ff86da unicodedata: overload many functions and methods (#9656) 2023-02-06 07:04:26 -08:00
Alex Waygood
ccb250940a Improve collections stubs (#9674) 2023-02-06 13:54:15 +01:00
Eclips4
cd5f976968 keyword: mark kwlist and softkwlist as Final (#9680) 2023-02-05 13:44:59 +00:00
Marc Mueller
88a761ed4e Export DataclassInstance protocol from _typeshed (#9676) 2023-02-04 15:58:11 +00:00
Alex Waygood
b9270da7b0 Improve readability of stdlib/_winapi.pyi (#9673) 2023-02-04 06:55:47 -08:00
Alex Waygood
1e3d762a12 stdlib: use bool for annotations where the default is False (#9672) 2023-02-04 11:58:18 +00:00
Akuli
37a180ef7b Use octal for mode defaults (#9670) 2023-02-03 19:12:53 +00:00
Jelle Zijlstra
5b24c7bb41 stdlib: Run stubdefaulter on Linux for 3.9 (#9663) 2023-02-03 00:39:22 +00:00
Alex Waygood
100cd62373 stdlib: Add bytes defaults (#9660) 2023-02-02 16:01:54 -08:00
Jelle Zijlstra
0fc3a567fc stdlib: add defaults for modules accessible on MacOS (#9659)
Ran stubdefaulter with standard options on a Mac.
2023-02-01 22:46:55 +00:00
Jelle Zijlstra
bc463a0677 Remove default for size parameter to multiprocessing.heap.Heap (#9658)
It's system-dependent. stubdefaulter told me `multiprocessing.heap.Heap: parameter size: stub default 4096 != runtime default 16384`, which presumably means it's 4096 on @AlexWaygood's system and 16384 on mine. I looked in the code and the default is set to `mmap.PAGESIZE`, which in turn is set from some system call at import time.
2023-02-01 22:43:50 +00:00
Alex Waygood
1d7dda7fa1 stdlib: Add defaults for positional-only parameters (#9655) 2023-02-01 21:44:08 +00:00
Alex Waygood
35172c7aab Stdlib: add some very large integer defaults (#9651)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-02-01 20:10:28 +00:00
Alex Waygood
8000fbd386 Bump various test dependencies (#9646) 2023-02-01 06:23:40 -08:00
Alex Waygood
8e7b78a8e8 Bump black to 23.1.0 (#9647) 2023-02-01 06:06:04 -08:00
Alex Waygood
7cd7ae46c0 Improve a few version-dependent tkinter functions (#9637) 2023-02-01 15:02:26 +02:00
Alex Waygood
2539649560 Add a default for ssl.SSLContext.__new__ on 3.10+ (#9635) 2023-01-31 17:30:00 -08:00
Alex Waygood
510bd460d2 Improve statistics.median_grouped on <=3.10 (#9636) 2023-01-31 17:29:01 -08:00
Alex Waygood
9e71de0421 Improve several stdlib setdefault methods (#9612) 2023-01-31 15:39:24 -08:00
Eclips4
3b4dbe36d4 ctypes._CData: Fix field name (#9633) 2023-01-31 09:16:39 +01:00
Alex Waygood
c54a1a9e16 urllib.parse: Fix issues with TypeVar usage and default values (#9629)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-01-31 02:21:50 +00:00
Alex Waygood
a6919227be Add several version-dependent default values to parameters in the stdlib (#9631) 2023-01-31 01:21:39 +00:00
Alex Waygood
81463b9995 tempfile.SpooledTemporaryFile: fix overloads (#9627) 2023-01-30 17:04:18 -08:00
Alex Waygood
8a098a8601 Various asyncio classes: remove the loop argument on 3.10 (#9630) 2023-01-30 16:55:08 -08:00
Alex Waygood
9099403d58 builtins.pow: Add default values to <py38 branches; remove incorrect = ...s for the 13th overload (#9610) 2023-01-30 18:12:50 +01:00
Alex Waygood
b748a9a543 distutils.filelist overloads: Remove unnecessary = ...s (#9619) 2023-01-30 18:02:57 +01:00
Alex Waygood
7958a7f934 RawConfigParser.__init__: fix overloads (#9613) 2023-01-30 18:00:43 +01:00
Alex Waygood
b5a26d1ca2 email.message: Fix invalid TypeVar usage; add some default values (#9620) 2023-01-30 17:56:29 +01:00
Alex Waygood
6011cac0cc Stdlib: fix three trivial issues with parameter defaults (#9618) 2023-01-29 21:40:56 -08:00
Alex Waygood
dd3aedd133 Correct str.maketrans and collections.UserString.maketrans (#9611) 2023-01-29 11:45:08 -08:00
Alex Waygood
5dfee6aa66 Add some missing py311+ constants to sre_constants.pyi (#9614) 2023-01-29 11:33:37 -08:00
Alex Waygood
c9f17d80fa _bisect: Remove incorrect = ...s for several overloads (#9609) 2023-01-29 10:06:39 -08:00
Alex Waygood
33a62ae42d Add more defaults to the stdlib (#9606)
Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00