Commit Graph

56 Commits

Author SHA1 Message Date
Jelle Zijlstra f32d9f08bd stdlib: add __slots__ (#14611) 2025-08-21 07:24:59 -07:00
Semyon Moroz 85a787bba3 [stdlib] Mark constants as Final (#14577) 2025-08-15 13:19:03 +02:00
Semyon Moroz 4ad58527c2 [socket] Use Final for constants (#14503) 2025-08-08 21:12:27 +02:00
Brian Schubert f88a09d479 Add @type_check_only to various typeshed-only procotols in stdlib (#14465)
Mark various typeshed-only protocols as `@type_check_only` in stdlib
2025-07-26 20:02:17 +01:00
Brian Schubert 74be9177e9 Fix stdlib stubtest for latest Python patch releases (#14220) 2025-06-05 19:01:31 -07:00
sobolevn 58a4def3c1 Update _socket and socket for 3.14 (#14055) 2025-05-14 12:23:38 +02:00
Brian Schubert c7b8fe9f06 Fix stdlib stubtest for latest Python patch releases (#13812) 2025-04-10 14:19:45 -07:00
Sebastian Rittau 30b16c168d Drop Python 3.8 branches (#13776) 2025-04-03 10:35:36 +02:00
Alex Waygood 5caaf2e1fb Fix stdlib stubtest for latest Python patch releases (#13464) 2025-02-05 23:33:27 +00:00
Maico Timmerman 3de624f980 Improve return type for socket.getaddrinfo for missing ipv6 support (#13372) 2025-01-06 14:40:07 +01:00
Stephen Morton 1798badcdd update for the new patch releases (#13196) 2024-12-05 18:24:07 +01:00
Stephen Morton c606b4f8ad add socket.AF_DECnet value (#13172) 2024-12-03 09:08:49 +01:00
Stephen Morton 308a09f056 Clean up/rework socket constants and add __all__ (#13044) 2024-11-20 14:05:11 +01:00
Stephen Morton f30d367c7a move socket.error classes from _socket to socket (#12746)
They're implemented in C, but consider themselves to live in
socket.
2024-10-05 18:19:34 -07:00
bytemarx a10e4135fe Add missing ETH_P_ALL identifier to socket (#11876) 2024-05-10 11:50:37 +02:00
Eric Traut 17f1c4628a Add precise values for enum members where possible (#11299)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-04-22 15:10:59 +01:00
Avasam 1a942aa36d Replace Flake8 checks with Ruff (except for flake8-pyi) (#11496)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-10 14:35:45 +00:00
Shantanu 470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Sebastian Rittau 53a8193d64 Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2024-01-05 08:15:19 -08:00
Sebastian Rittau 23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Shantanu 2cafcc90a7 socket: rework to match docs more closely, improve accuracy on linux (#11219)
Match the documentation more closely

Fixes some of #8101
2024-01-04 14:36:31 -08:00
Nikita Sobolev bd4462cc62 Re-export SYSPROTO_CONTROL and PF_SYSTEM in socket on macos (#10814) 2023-10-01 15:38:44 +01:00
Shane Smiskol 5e2fe131fa Add missing TCP_USER_TIMEOUT to socket module (#10530) 2023-08-04 21:11:14 +01:00
Nikita Sobolev 702226e1fd Add missing TCP_CONNECTION_INFO to socket module (#10402) 2023-07-04 12:32:38 +02:00
Nikita Sobolev 9456f5501b Update socket stubs for Python3.12 (#10247)
Docs: https://github.com/python/cpython/blob/3.12/Doc/library/socket.rst
Source: https://github.com/python/cpython/blob/3.12/Modules/socketmodule.c#L8441
2023-06-05 09:32:02 +01:00
Alex Waygood 6ba28ae547 Remove unused type: ignore comments (#9801) 2023-02-23 12:59:50 -08:00
Alex Waygood 9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00: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 d98d1674e7 Fix a few issues with parameter defaults (#9572) 2023-01-20 09:47:59 -08: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
Jelle Zijlstra cff08b674a isort: Add more to extra_standard_library (#9098) 2022-11-04 22:56:40 -07:00
Jelle Zijlstra 287fce4872 ssl, socket, array: Improve bytes handling (#8997) 2022-10-28 15:35:51 +02:00
Kevin Kirsche a8c8178127 Add missing NETLINK re-exports of linux socket constants (#8555) 2022-08-18 20:24:58 +01:00
Alex Waygood edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood c6de37df53 Overhaul socket stubs on Windows and MacOS (#8106)
Reduce the `socket` allowlists for these platforms to a handful of missing constants
2022-06-20 20:11:50 +01:00
Shantanu 34579f1edf socket: add TCP_KEEPALIVE (#8100)
bpo-34932

Co-authored-by: hauntsaninja <>
2022-06-19 17:57:07 +01:00
Alex Waygood 411d85feeb socket.AddressFamily: Fix AF_LINK (#8103)
Slipped through the net in #8099
2022-06-19 09:10:33 +01:00
Shantanu b7f8d847be socket: consistency between constants and enums (#8099)
This matches what happens at runtime, from Enum._convert_
Helps with #8098. Closes #5696.
2022-06-19 08:57:55 +01:00
Sebastian Rittau f21898abb9 Improve I/O types in socket.pyi (#7852)
* Use a protocol for socket.sendfile() "file" argument.
* Use concrete classes for socket.makefile() return types.
2022-05-17 06:11:50 -07:00
Jelle Zijlstra ab1dcafec2 socket: add SO_INCOMING_CPU for 3.11 (#7801)
python/cpython#31237
2022-05-06 22:46:34 -07:00
Jelle Zijlstra 85a6f0ffe9 socket: add all_errors param to create_connection (#7691)
python/cpython#91704
2022-04-25 22:10:29 -06:00
Alex Waygood 74ecce5b68 Improve host parameter of socket.getaddrinfo() (#7518)
As pointed out by @srittau in #7517, `bytearray` [is redundant](https://docs.python.org/3/library/typing.html#typing.ByteString) in a union where `bytes` is also in the union.
2022-03-20 23:35:03 +00:00
Martin Fischer 8138981492 stdlib: socket.CMSG_LEN & socket.CMSG_SPACE are only available on Unix (#7384) 2022-03-06 16:04:05 -08:00
Alex Waygood 96c9abb058 Always use _typeshed.Self, where applicable (#6880)
* Always use `_typeshed.Self`, where applicable

* Revert changes to `google-cloud-ndb` (ambiguous)

* Remove empty line added by script

* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`

* Manually add a few more that the script missed

* Improve `filelock` annotation

Source code here: https://github.com/tox-dev/py-filelock/blob/79ec7b2826e33b982fe83b057f359448b9d966ba/src/filelock/_api.py#L207

* Improve `opentracing/scope` annotation

Source code here: https://github.com/opentracing/opentracing-python/blob/3e1d357a348269ef54d67f761302fab93dbfc0f7/opentracing/scope.py#L71

* Improve `redis/client` stub

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/client.py#L1217

* Improve `redis/lock` annotation

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/lock.py#L155

* Improve `requests/models` annotation

Source code here: https://github.com/psf/requests/blob/d718e753834b84018014a23d663369ac27d1ab9c/requests/models.py#L653
2022-01-09 19:16:19 -08:00
Rui Cunha d00b3b2d12 Add socket.IPPROTO_MPTCP (#6863) 2022-01-08 20:57:03 +02:00
Akuli a5bc1e037f Add mypy error codes to '# type: ignore' comments (#6379) 2021-11-26 07:07:56 +01:00
Stefan Tatschner 7720f9b7df Add CAN_RAW_JOIN_FILTERS constant to socket stub (#6159)
This constant has been added in python 3.9.
2021-10-13 16:29:03 +02:00
Akuli ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Anton Grübel 96e0660fba Use _typeshed.Self with __enter__ (#5717)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-07-01 12:32:32 +02:00