Sitelet https://github.com/python/cpython/commit/40bed8a536770551b2a6b3ad58278cc623722b72
Skip to content

Commit 40bed8a

Browse files
committed
issue28083: add IntFlag constants
1 parent f93395b commit 40bed8a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎Lib/socket.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from _socket import *
5151

5252
import os, sys, io, selectors
53-
from enum import IntEnum
53+
from enum import IntEnum, IntFlag
5454

5555
try:
5656
import errno
@@ -80,6 +80,16 @@
8080
__name__,
8181
lambda C: C.isupper() and C.startswith('SOCK_'))
8282

83+
IntFlag._convert(
84+
'MsgFlag',
85+
__name__,
86+
lambda C: C.isupper() and C.startswith('MSG_'))
87+
88+
IntFlag._convert(
89+
'AddressInfo',
90+
__name__,
91+
lambda C: C.isupper() and C.startswith('AI_'))
92+
8393
_LOCALHOST = '127.0.0.1'
8494
_LOCALHOST_V6 = '::1'
8595

0 commit comments

Comments
 (0)