mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-26 05:41:11 +08:00
socket: consistency between constants and enums (#8099)
This matches what happens at runtime, from Enum._convert_ Helps with #8098. Closes #5696.
This commit is contained in:
@@ -390,39 +390,43 @@ class AddressFamily(IntEnum):
|
||||
AF_INET: int
|
||||
AF_INET6: int
|
||||
AF_AAL5: int
|
||||
AF_ALG: int
|
||||
AF_APPLETALK: int
|
||||
AF_ASH: int
|
||||
AF_ATMPVC: int
|
||||
AF_ATMSVC: int
|
||||
AF_AX25: int
|
||||
AF_BLUETOOTH: int
|
||||
AF_BRIDGE: int
|
||||
AF_CAN: int
|
||||
AF_DECnet: int
|
||||
AF_ECONET: int
|
||||
AF_IPX: int
|
||||
AF_IRDA: int
|
||||
AF_KEY: int
|
||||
AF_LINK: int
|
||||
AF_LLC: int
|
||||
AF_NETBEUI: int
|
||||
AF_NETLINK: int
|
||||
AF_NETROM: int
|
||||
AF_PACKET: int
|
||||
AF_PPPOX: int
|
||||
AF_QIPCRTR: int
|
||||
AF_RDS: int
|
||||
AF_ROSE: int
|
||||
AF_ROUTE: int
|
||||
AF_SECURITY: int
|
||||
AF_SNA: int
|
||||
AF_SYSTEM: int
|
||||
AF_TIPC: int
|
||||
AF_UNSPEC: int
|
||||
AF_VSOCK: int
|
||||
AF_WANPIPE: int
|
||||
AF_X25: int
|
||||
if sys.platform == "linux":
|
||||
AF_CAN: int
|
||||
AF_PACKET: int
|
||||
AF_RDS: int
|
||||
AF_TIPC: int
|
||||
AF_ALG: int
|
||||
AF_NETLINK: int
|
||||
if sys.version_info >= (3, 7):
|
||||
AF_VSOCK: int
|
||||
if sys.version_info >= (3, 8):
|
||||
AF_QIPCRTR: int
|
||||
AF_LINK: AddressFamily # availability: BSD, macOS
|
||||
if sys.platform != "darwin":
|
||||
AF_BLUETOOTH: int
|
||||
|
||||
AF_UNIX: AddressFamily
|
||||
AF_INET: AddressFamily
|
||||
@@ -463,7 +467,7 @@ if sys.platform == "linux":
|
||||
if sys.version_info >= (3, 8):
|
||||
AF_QIPCRTR: AddressFamily
|
||||
AF_LINK: AddressFamily # availability: BSD, macOS
|
||||
if sys.platform != "win32" and sys.platform != "darwin":
|
||||
if sys.platform != "darwin":
|
||||
AF_BLUETOOTH: AddressFamily
|
||||
|
||||
class SocketKind(IntEnum):
|
||||
@@ -472,8 +476,9 @@ class SocketKind(IntEnum):
|
||||
SOCK_RAW: int
|
||||
SOCK_RDM: int
|
||||
SOCK_SEQPACKET: int
|
||||
SOCK_CLOEXEC: int
|
||||
SOCK_NONBLOCK: int
|
||||
if sys.platform == "linux":
|
||||
SOCK_CLOEXEC: int
|
||||
SOCK_NONBLOCK: int
|
||||
|
||||
SOCK_STREAM: SocketKind
|
||||
SOCK_DGRAM: SocketKind
|
||||
@@ -485,10 +490,22 @@ if sys.platform == "linux":
|
||||
SOCK_NONBLOCK: SocketKind
|
||||
|
||||
class MsgFlag(IntFlag):
|
||||
MSG_BCAST: int
|
||||
MSG_BTAG: int
|
||||
MSG_CMSG_CLOEXEC: int
|
||||
MSG_CONFIRM: int
|
||||
MSG_CTRUNC: int
|
||||
MSG_DONTROUTE: int
|
||||
MSG_DONTWAIT: int
|
||||
MSG_EOF: int
|
||||
MSG_EOR: int
|
||||
MSG_ERRQUEUE: int
|
||||
MSG_ETAG: int
|
||||
MSG_FASTOPEN: int
|
||||
MSG_MCAST: int
|
||||
MSG_MORE: int
|
||||
MSG_NOSIGNAL: int
|
||||
MSG_NOTIFICATION: int
|
||||
MSG_OOB: int
|
||||
MSG_PEEK: int
|
||||
MSG_TRUNC: int
|
||||
@@ -519,10 +536,13 @@ class AddressInfo(IntFlag):
|
||||
AI_ADDRCONFIG: int
|
||||
AI_ALL: int
|
||||
AI_CANONNAME: int
|
||||
AI_DEFAULT: int
|
||||
AI_MASK: int
|
||||
AI_NUMERICHOST: int
|
||||
AI_NUMERICSERV: int
|
||||
AI_PASSIVE: int
|
||||
AI_V4MAPPED: int
|
||||
AI_V4MAPPED_CFG: int
|
||||
|
||||
AI_ADDRCONFIG: AddressInfo
|
||||
AI_ALL: AddressInfo
|
||||
|
||||
@@ -16,10 +16,6 @@ distutils.msvccompiler.MSVCCompiler.set_path_env_var
|
||||
distutils.msvccompiler.MacroExpander
|
||||
mimetypes.MimeTypes.read_windows_registry
|
||||
selectors.DefaultSelector.fileno
|
||||
socket.AddressInfo.AI_DEFAULT
|
||||
socket.AddressInfo.AI_MASK
|
||||
socket.AddressInfo.AI_V4MAPPED_CFG
|
||||
socket.MsgFlag.MSG_EOF
|
||||
|
||||
posix.NGROUPS_MAX
|
||||
posix.error.characters_written
|
||||
|
||||
@@ -17,12 +17,6 @@ distutils.msvccompiler.MSVCCompiler.set_path_env_var
|
||||
distutils.msvccompiler.MacroExpander
|
||||
mimetypes.MimeTypes.read_windows_registry
|
||||
selectors.DefaultSelector.fileno
|
||||
socket.MsgFlag.MSG_CMSG_CLOEXEC
|
||||
socket.MsgFlag.MSG_CONFIRM
|
||||
socket.MsgFlag.MSG_ERRQUEUE
|
||||
socket.MsgFlag.MSG_FASTOPEN
|
||||
socket.MsgFlag.MSG_MORE
|
||||
socket.MsgFlag.MSG_NOSIGNAL
|
||||
spwd.struct_spwd.sp_nam
|
||||
spwd.struct_spwd.sp_pwd
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ asyncio.windows_events.IocpProactor.recvfrom
|
||||
asyncio.windows_events.IocpProactor.sendto
|
||||
distutils.command.build_ext.__warningregistry__
|
||||
msvcrt.GetErrorMode
|
||||
socket.MsgFlag.MSG_ERRQUEUE
|
||||
subprocess.STARTUPINFO.copy
|
||||
|
||||
# ==========
|
||||
|
||||
@@ -12,7 +12,6 @@ asyncio.windows_events.IocpProactor.sendto
|
||||
distutils.command.build_ext.__warningregistry__
|
||||
msvcrt.GetErrorMode
|
||||
os.EX_OK
|
||||
socket.MsgFlag.MSG_ERRQUEUE
|
||||
subprocess.STARTUPINFO.copy
|
||||
|
||||
# ==========
|
||||
|
||||
@@ -10,9 +10,6 @@ urllib.parse.parse_qsl
|
||||
|
||||
os.startfile
|
||||
|
||||
# Exists at runtime, but missing from stubs
|
||||
socket.MsgFlag.MSG_ERRQUEUE
|
||||
|
||||
# ==========
|
||||
# Allowlist entries that cannot or should not be fixed
|
||||
# ==========
|
||||
|
||||
@@ -7,7 +7,6 @@ asyncio.IocpProactor.recvfrom
|
||||
asyncio.IocpProactor.sendto
|
||||
asyncio.windows_events.IocpProactor.recvfrom
|
||||
asyncio.windows_events.IocpProactor.sendto
|
||||
socket.MsgFlag.MSG_ERRQUEUE
|
||||
subprocess.STARTUPINFO.copy
|
||||
|
||||
# ==========
|
||||
|
||||
@@ -7,7 +7,6 @@ asyncio.IocpProactor.recvfrom
|
||||
asyncio.IocpProactor.sendto
|
||||
asyncio.windows_events.IocpProactor.recvfrom
|
||||
asyncio.windows_events.IocpProactor.sendto
|
||||
socket.MsgFlag.MSG_ERRQUEUE
|
||||
subprocess.STARTUPINFO.copy
|
||||
|
||||
# ==========
|
||||
|
||||
@@ -27,8 +27,6 @@ distutils.msvccompiler.MSVCCompiler.manifest_get_embed_info
|
||||
distutils.msvccompiler.MSVCCompiler.manifest_setup_ldargs
|
||||
distutils.msvccompiler.OldMSVCCompiler
|
||||
msvcrt.SetErrorMode
|
||||
socket.MsgFlag.MSG_BCAST
|
||||
socket.MsgFlag.MSG_MCAST
|
||||
ssl.SSLSocket.recvmsg
|
||||
ssl.SSLSocket.recvmsg_into
|
||||
ssl.SSLSocket.sendmsg
|
||||
|
||||
Reference in New Issue
Block a user