Commit Graph

4742 Commits

Author SHA1 Message Date
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
Alex Waygood
b316dd947e Bump flake8-pyi to 23.1.1 (#9599) 2023-01-28 07:39:30 -08:00
Alex Waygood
32ebe323f5 Use a TypeGuard for dataclasses.is_dataclass(); refine asdict(), astuple(), fields(), replace() (#9362) 2023-01-28 15:14:22 +00:00
Alex Waygood
7f986bdf85 Add more overloads to the re stubs to help out pyright (#9592) 2023-01-27 18:32:50 -08:00
Adam Orr
0fe3ef28fe codecs: _buffer_encode returns (bytes, int) (#9587) 2023-01-25 20:39:21 +01:00
Alex Waygood
a9b4fa0a32 Fix some stubtest complaints before they happen (#9585)
Add missing objects to various stubs
2023-01-24 21:45:31 +00:00
Alex Waygood
307aadc632 Improve the signature of types.MappingProxyType.__eq__ (#9581) 2023-01-23 14:41:27 +01:00
Jukka Lehtosalo
d5b88c552c Add __eq__ to types.MappingProxyType (#9580)
The type has a custom __eq__:
https://github.com/python/cpython/blob/v3.11.1/Objects/descrobject.c#L1906

This helps fix this mypy false positive when using `--strict-equality`:
```
from types import MappingProxyType

p = MappingProxyType({'x': 1})
d = {'x': 1}
print(p == d)  # error: Non-overlapping equality check
```

The fragment prints `True` so the comparison is valid.
2023-01-23 09:55:25 +00:00
Seth Michael Larson
ebba92c986 Add SSLContext.security_level property for Python 3.10 (#9577) 2023-01-22 19:28:44 +01:00
gandalf3
b11e2e37c6 create_datagram_endpoint expects a str when family=AF_UNIX (#9574)
Since python 3.7, asyncio.loop.create_datagram_endpoint expects the
arguments `local_addr` and `remote_addr` to be `str` or `None` when the
argument family=`socket.AF_UNIX` and the argument `sock` is `None` or
also a unix socket.
2023-01-21 22:00:44 +01:00
Alex Waygood
d98d1674e7 Fix a few issues with parameter defaults (#9572) 2023-01-20 09:47:59 -08:00
Jelle Zijlstra
af2ce282d5 builtins: do the TODO on compile() (#9567) 2023-01-18 11:48:48 -08:00