Commit Graph

4716 Commits

Author SHA1 Message Date
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
Jelle Zijlstra
aa4d6d87ae asyncio: fix default for subprocess_exec (#9561) 2023-01-18 15:03:22 +01:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Avasam
c70d303985 Audit stdlib object annotations (#9519) 2023-01-17 15:40:00 +00:00
Alex Waygood
597e1a0078 Bump various test dependencies (#9549) 2023-01-16 11:04:45 -08:00
Kalle Møller
6b23df3db6 Update _FilterType to retuning bool (#9514) 2023-01-16 16:12:40 +01:00
James Hilton-Balfe
62170653ce Add itertools.batched (#9515) 2023-01-12 22:07:26 +00:00
Jelle Zijlstra
b43e1db47b ssl, sysconfig: fix issues with defaults (#9507)
- ssl._create_unverified_context allows None since 3.10:
  2875c603b2 (diff-f6439be9c66350dde4c35dbeea0352c96cc970ba12b0478f6ae36f10725bd8c5)
- sysconfig.is_python_build ignores its argument since 3.11:
  067597522a
  (was backported into 3.11)
2023-01-12 10:19:41 -08:00
Avasam
aad1a14890 Use the FileDescriptorOrPath alias consistently in the stdlib (#9513) 2023-01-12 18:14:48 +00:00
Jelle Zijlstra
f64807a468 socketserver: improve bytes handling (#9096)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-12 16:46:20 +00:00
Jelle Zijlstra
b9eab637cb subprocess: Improve bytes-related types (#9100) 2023-01-11 20:10:26 -08:00
Jelle Zijlstra
6a366c99a9 venv: add logger (#9508)
Not particularly useful but unreleased stubtest will require this:
https://github.com/python/typeshed/actions/runs/3898630022/jobs/6657546205
2023-01-11 19:33:16 -08:00
Jelle Zijlstra
1ce1c1ad17 subprocess: universal_newlines may be None (#9509)
All the way back to 3.7:
https://github.com/python/cpython/blob/3.7/Lib/subprocess.py#L684

It's treated like False
2023-01-11 19:15:40 -08:00
Jelle Zijlstra
d2829ecdf7 urllib.parse.urlencode: encoding and errors can be None (#9506)
The runtime defaults are None. Found in #9501.
2023-01-11 18:55:38 -08:00
Shantanu
fa204f6bd4 Update compileall stripdir type (#9404)
See https://github.com/python/cpython/pull/19883
2023-01-08 22:26:33 -08:00
Avasam
41de5317b5 Add FileDescriptorOrPath and Unused type aliases (#9475) 2023-01-08 10:05:51 +00:00
Martin Fischer
554989e31f stdlib: Fix types of semi-public Message methods (#9456) 2023-01-04 11:21:33 +01:00
Ethan Furman
3aceb1abd5 Update SimpleHTTPRequestHandler for changes in 3.12 (#9452)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-03 23:59:40 +00:00
Ned Batchelder
379d449894 zipimporter.get_data returns bytes, not str(#9428)
Fixes #9427
2022-12-29 13:59:51 -08:00
Nikita Sobolev
6f6dad117d compile can only work with ast.Module | ast.Expression | ast.Interactive (#9424) 2022-12-29 11:25:07 +01:00
Avasam
23ac9bff19 Check for unused pyright: ignore and differentiate from mypy ignores (#9397) 2022-12-28 10:44:29 +00:00
Alex Waygood
27983aa929 ast.NodeVisitor: add visit_TryStar on 3.11+ (#9418) 2022-12-27 18:36:53 +01:00
Will Frey
f174355b31 Allow indent to be str in JSONEncoder (#9417) 2022-12-27 16:26:16 +01:00
Alex Waygood
116229d0ac datetime: various parameters can now safely be passed as keyword arguments on 3.12+ (#9415) 2022-12-27 14:35:29 +00:00
zhykzhykzhyk
d6237d09c7 Add constructor to CellType (#9399) 2022-12-26 20:43:35 -08:00
Alex Waygood
154452ffc2 ast.NodeVisitor: Add visit_* methods for ast nodes new in 3.8-3.10 (#9413) 2022-12-26 20:27:44 -08:00
Nikita Sobolev
0e4c59a076 ast.get_docstring does not work with arbitrary AST nodes (#9407) 2022-12-24 18:43:44 +00:00