Skip to content
Closed
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
61b540f
socket : add python 3.14 bluetooth constants for windows and linux
Divyanshudevtalla Jan 27, 2026
f460d10
socket: add Python 3.14 bluetooth constant with version guards
Divyanshudevtalla Jan 27, 2026
541eb42
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 27, 2026
8875184
address review: move constants to semi-documented and add allowlist …
Divyanshudevtalla Jan 28, 2026
83ca700
address review : move constants to semi-documented and fix version gu…
Divyanshudevtalla Jan 28, 2026
d8ee6b5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 28, 2026
717f7cb
fix: resolve merge conflict and update allowlist
Divyanshudevtalla Jan 28, 2026
74c8f48
fix: resolve sync issue and finalize allowlist
Divyanshudevtalla Jan 28, 2026
3efa725
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 28, 2026
b9f25b7
fix : resolve all CI faillures by updating socket.pyi and cleaning ma…
Divyanshudevtalla Jan 28, 2026
78ddaf3
fix: sync with remote and finalize socket constants
Divyanshudevtalla Jan 28, 2026
096518f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 28, 2026
e5a8806
refactor: remove duplicates,sort alphabatecally, and update allowlist
Divyanshudevtalla Jan 28, 2026
ac8ecb8
Merge branch 'add-bluetooth-constants' of https://github.com/Divyansh…
Divyanshudevtalla Jan 28, 2026
f2eb6ac
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 28, 2026
16415a6
Fix : add missing runtime constants to linux-py314 allowlist
Divyanshudevtalla Jan 29, 2026
a987b39
Fix: add platform-specific allowlists and remove reduntant entries
Divyanshudevtalla Jan 29, 2026
d73e6e7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2026
a7e5293
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2026
b1a62e3
fix : remaining fails fix
Divyanshudevtalla Jan 29, 2026
457e7fe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2026
e0056ab
Fix : update plateform allowlist
Divyanshudevtalla Jan 29, 2026
db48b40
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2026
e8bff12
updating fixes
Divyanshudevtalla Jan 29, 2026
7827112
fix updating
Divyanshudevtalla Jan 29, 2026
4cf8971
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 76 additions & 3 deletions stdlib/_socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _CMSGArg: TypeAlias = tuple[int, int, ReadableBuffer]
# Addresses can be either tuples of varying lengths (AF_INET, AF_INET6,
# AF_NETLINK, AF_TIPC) or strings/buffers (AF_UNIX).
# See getsockaddrarg() in socketmodule.c.
_Address: TypeAlias = tuple[Any, ...] | str | ReadableBuffer
_Address: TypeAlias = tuple[Any, ...] | str | ReadableBuffer | int
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above should be modified to explain why int is included.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out! I’ll update the comment to explain why int is included.

_RetAddress: TypeAlias = Any

# ===== Constants =====
Expand All @@ -34,8 +34,76 @@ SOCK_SEQPACKET: Final[int]

if sys.platform == "linux":
# Availability: Linux >= 2.6.27
SOCK_CLOEXEC: Final[int]
SOCK_NONBLOCK: Final[int]
if sys.version_info >= (3, 14):
SOCK_CLOEXEC: Final[int]
SOCK_NONBLOCK: Final[int]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two should not be changed to have a condition on the Python version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for correction! I`ve updated the change so these are not conditional on the python version

BDADDR_BREDR: Final[int]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect all of the Bluetooth stuff to be grouped together with the existing "semi-documented constants" below line 635.

# Semi-documented constants

Same comment applies to the Windows-only constants.

BDADDR_LE_PUBLIC: Final[int]
BDADDR_LE_RANDOM: Final[int]
BT_CHANNEL_POLICY: Final[int]
BT_CHANNEL_POLICY_BREDR_ONLY: Final[int]
BT_CHANNEL_POLICY_BREDR_PREFERRED: Final[int]
BT_CODEC: Final[int]
BT_DEFER_SETUP: Final[int]
BT_FLUSHABLE: Final[int]
BT_FLUSHABLE_OFF: Final[int]
BT_FLUSHABLE_ON: Final[int]
BT_ISO_QOS: Final[int]
BT_MODE: Final[int]
BT_MODE_BASIC: Final[int]
BT_MODE_ERTM: Final[int]
BT_MODE_EXT_FLOWCTL: Final[int]
BT_MODE_LE_FLOWCTL: Final[int]
BT_MODE_STREAMING: Final[int]
BT_PHY: Final[int]
BT_PHY_BR_1M_1SLOT: Final[int]
BT_PHY_BR_1M_3SLOT: Final[int]
BT_PHY_BR_1M_5SLOT: Final[int]
BT_PHY_EDR_2M_1SLOT: Final[int]
BT_PHY_EDR_2M_3SLOT: Final[int]
BT_PHY_EDR_2M_5SLOT: Final[int]
BT_PHY_EDR_3M_1SLOT: Final[int]
BT_PHY_EDR_3M_3SLOT: Final[int]
BT_PHY_EDR_3M_5SLOT: Final[int]
BT_PHY_LE_1M_RX: Final[int]
BT_PHY_LE_1M_TX: Final[int]
BT_PHY_LE_2M_RX: Final[int]
BT_PHY_LE_2M_TX: Final[int]
BT_PHY_LE_CODED_RX: Final[int]
BT_PHY_LE_CODED_TX: Final[int]
BT_PKT_STATUS: Final[int]
BT_POWER: Final[int]
BT_POWER_FORCE_ACTIVE_OFF: Final[int]
BT_POWER_FORCE_ACTIVE_ON: Final[int]
BT_RCVMTU: Final[int]
BT_SECURITY: Final[int]
BT_SECURITY_FIPS: Final[int]
BT_SECURITY_HIGH: Final[int]
BT_SECURITY_LOW: Final[int]
BT_SECURITY_MEDIUM: Final[int]
BT_SECURITY_SDP: Final[int]
BT_SNDMTU: Final[int]
BT_VOICE: Final[int]
BT_VOICE_CVSD_16BIT: Final[int]
BT_VOICE_TRANSPARENT: Final[int]
BT_VOICE_TRANSPARENT_16BIT: Final[int]
HCI_CHANNEL_CONTROL: Final[int]
HCI_CHANNEL_LOGGING: Final[int]
HCI_CHANNEL_MONITOR: Final[int]
HCI_CHANNEL_RAW: Final[int]
HCI_CHANNEL_USER: Final[int]
HCI_DEV_NONE: Final[int]
L2CAP_LM: Final[int]
L2CAP_LM_AUTH: Final[int]
L2CAP_LM_ENCRYPT: Final[int]
L2CAP_LM_MASTER: Final[int]
L2CAP_LM_RELIABLE: Final[int]
L2CAP_LM_SECURE: Final[int]
L2CAP_LM_TRUSTED: Final[int]
SOL_BLUETOOTH: Final[int]
SOL_L2CAP: Final[int]
SOL_RFCOMM: Final[int]
SOL_SCO: Final[int]

# --------------------
# Many constants of these forms, documented in the Unix documentation on
Expand Down Expand Up @@ -76,6 +144,11 @@ if sys.platform != "linux":
SO_USELOOPBACK: Final[int]
if sys.platform == "win32":
SO_EXCLUSIVEADDRUSE: Final[int]
SO_BTH_ENCRYPT: Final[int]
SO_BTH_MTU: Final[int]
SO_BTH_MTU_MAX: Final[int]
SO_BTH_MTU_MIN: Final[int]
SOL_RFCOMM: Final[int]
if sys.platform != "win32":
SO_REUSEPORT: Final[int]
if sys.platform != "darwin" or sys.version_info >= (3, 13):
Expand Down
Loading