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>
This commit is contained in:
Eric Traut
2024-04-22 07:10:59 -07:00
committed by GitHub
parent b3bfbefa7f
commit 17f1c4628a
36 changed files with 1093 additions and 1087 deletions

View File

@@ -15,6 +15,6 @@ if sys.version_info >= (3, 12):
THREAD_JOIN_TIMEOUT: Literal[300]
class _SendfileMode(enum.Enum):
UNSUPPORTED: int
TRY_NATIVE: int
FALLBACK: int
UNSUPPORTED = 1
TRY_NATIVE = 2
FALLBACK = 3

View File

@@ -101,10 +101,10 @@ class BoundedSemaphore(Semaphore): ...
if sys.version_info >= (3, 11):
class _BarrierState(enum.Enum): # undocumented
FILLING: str
DRAINING: str
RESETTING: str
BROKEN: str
FILLING = "filling"
DRAINING = "draining"
RESETTING = "resetting"
BROKEN = "broken"
class Barrier(_LoopBoundMixin):
def __init__(self, parties: int) -> None: ...

View File

@@ -14,17 +14,17 @@ if sys.version_info >= (3, 11):
SSLAgainErrors: tuple[type[ssl.SSLWantReadError], type[ssl.SSLSyscallError]]
class SSLProtocolState(Enum):
UNWRAPPED: str
DO_HANDSHAKE: str
WRAPPED: str
FLUSHING: str
SHUTDOWN: str
UNWRAPPED = "UNWRAPPED"
DO_HANDSHAKE = "DO_HANDSHAKE"
WRAPPED = "WRAPPED"
FLUSHING = "FLUSHING"
SHUTDOWN = "SHUTDOWN"
class AppProtocolState(Enum):
STATE_INIT: str
STATE_CON_MADE: str
STATE_EOF: str
STATE_CON_LOST: str
STATE_INIT = "STATE_INIT"
STATE_CON_MADE = "STATE_CON_MADE"
STATE_EOF = "STATE_EOF"
STATE_CON_LOST = "STATE_CON_LOST"
def add_flowcontrol_defaults(high: int | None, low: int | None, kb: int) -> tuple[int, int]: ...

View File

@@ -15,65 +15,65 @@ class HTTPStatus(IntEnum):
def phrase(self) -> str: ...
@property
def description(self) -> str: ...
CONTINUE: int
SWITCHING_PROTOCOLS: int
PROCESSING: int
OK: int
CREATED: int
ACCEPTED: int
NON_AUTHORITATIVE_INFORMATION: int
NO_CONTENT: int
RESET_CONTENT: int
PARTIAL_CONTENT: int
MULTI_STATUS: int
ALREADY_REPORTED: int
IM_USED: int
MULTIPLE_CHOICES: int
MOVED_PERMANENTLY: int
FOUND: int
SEE_OTHER: int
NOT_MODIFIED: int
USE_PROXY: int
TEMPORARY_REDIRECT: int
PERMANENT_REDIRECT: int
BAD_REQUEST: int
UNAUTHORIZED: int
PAYMENT_REQUIRED: int
FORBIDDEN: int
NOT_FOUND: int
METHOD_NOT_ALLOWED: int
NOT_ACCEPTABLE: int
PROXY_AUTHENTICATION_REQUIRED: int
REQUEST_TIMEOUT: int
CONFLICT: int
GONE: int
LENGTH_REQUIRED: int
PRECONDITION_FAILED: int
REQUEST_ENTITY_TOO_LARGE: int
REQUEST_URI_TOO_LONG: int
UNSUPPORTED_MEDIA_TYPE: int
REQUESTED_RANGE_NOT_SATISFIABLE: int
EXPECTATION_FAILED: int
UNPROCESSABLE_ENTITY: int
LOCKED: int
FAILED_DEPENDENCY: int
UPGRADE_REQUIRED: int
PRECONDITION_REQUIRED: int
TOO_MANY_REQUESTS: int
REQUEST_HEADER_FIELDS_TOO_LARGE: int
INTERNAL_SERVER_ERROR: int
NOT_IMPLEMENTED: int
BAD_GATEWAY: int
SERVICE_UNAVAILABLE: int
GATEWAY_TIMEOUT: int
HTTP_VERSION_NOT_SUPPORTED: int
VARIANT_ALSO_NEGOTIATES: int
INSUFFICIENT_STORAGE: int
LOOP_DETECTED: int
NOT_EXTENDED: int
NETWORK_AUTHENTICATION_REQUIRED: int
MISDIRECTED_REQUEST: int
UNAVAILABLE_FOR_LEGAL_REASONS: int
CONTINUE = 100
SWITCHING_PROTOCOLS = 101
PROCESSING = 102
OK = 200
CREATED = 201
ACCEPTED = 202
NON_AUTHORITATIVE_INFORMATION = 203
NO_CONTENT = 204
RESET_CONTENT = 205
PARTIAL_CONTENT = 206
MULTI_STATUS = 207
ALREADY_REPORTED = 208
IM_USED = 226
MULTIPLE_CHOICES = 300
MOVED_PERMANENTLY = 301
FOUND = 302
SEE_OTHER = 303
NOT_MODIFIED = 304
USE_PROXY = 305
TEMPORARY_REDIRECT = 307
PERMANENT_REDIRECT = 308
BAD_REQUEST = 400
UNAUTHORIZED = 401
PAYMENT_REQUIRED = 402
FORBIDDEN = 403
NOT_FOUND = 404
METHOD_NOT_ALLOWED = 405
NOT_ACCEPTABLE = 406
PROXY_AUTHENTICATION_REQUIRED = 407
REQUEST_TIMEOUT = 408
CONFLICT = 409
GONE = 410
LENGTH_REQUIRED = 411
PRECONDITION_FAILED = 412
REQUEST_ENTITY_TOO_LARGE = 413
REQUEST_URI_TOO_LONG = 414
UNSUPPORTED_MEDIA_TYPE = 415
REQUESTED_RANGE_NOT_SATISFIABLE = 416
EXPECTATION_FAILED = 417
UNPROCESSABLE_ENTITY = 422
LOCKED = 423
FAILED_DEPENDENCY = 424
UPGRADE_REQUIRED = 426
PRECONDITION_REQUIRED = 428
TOO_MANY_REQUESTS = 429
REQUEST_HEADER_FIELDS_TOO_LARGE = 431
INTERNAL_SERVER_ERROR = 500
NOT_IMPLEMENTED = 501
BAD_GATEWAY = 502
SERVICE_UNAVAILABLE = 503
GATEWAY_TIMEOUT = 504
HTTP_VERSION_NOT_SUPPORTED = 505
VARIANT_ALSO_NEGOTIATES = 506
INSUFFICIENT_STORAGE = 507
LOOP_DETECTED = 508
NOT_EXTENDED = 510
NETWORK_AUTHENTICATION_REQUIRED = 511
MISDIRECTED_REQUEST = 421
UNAVAILABLE_FOR_LEGAL_REASONS = 451
if sys.version_info >= (3, 9):
EARLY_HINTS: Literal[103]
IM_A_TEAPOT: Literal[418]
@@ -94,12 +94,12 @@ if sys.version_info >= (3, 11):
class HTTPMethod(StrEnum):
@property
def description(self) -> str: ...
CONNECT: str
DELETE: str
GET: str
HEAD: str
OPTIONS: str
PATCH: str
POST: str
PUT: str
TRACE: str
CONNECT = "CONNECT"
DELETE = "DELETE"
GET = "GET"
HEAD = "HEAD"
OPTIONS = "OPTIONS"
PATCH = "PATCH"
POST = "POST"
PUT = "PUT"
TRACE = "TRACE"

View File

@@ -347,11 +347,11 @@ if sys.version_info >= (3, 10):
# The name is the same as the enum's name in CPython
class _ParameterKind(enum.IntEnum):
POSITIONAL_ONLY: int
POSITIONAL_OR_KEYWORD: int
VAR_POSITIONAL: int
KEYWORD_ONLY: int
VAR_KEYWORD: int
POSITIONAL_ONLY = 0
POSITIONAL_OR_KEYWORD = 1
VAR_POSITIONAL = 2
KEYWORD_ONLY = 3
VAR_KEYWORD = 4
@property
def description(self) -> str: ...
@@ -611,22 +611,22 @@ if sys.version_info >= (3, 9):
if sys.version_info >= (3, 12):
class BufferFlags(enum.IntFlag):
SIMPLE: int
WRITABLE: int
FORMAT: int
ND: int
STRIDES: int
C_CONTIGUOUS: int
F_CONTIGUOUS: int
ANY_CONTIGUOUS: int
INDIRECT: int
CONTIG: int
CONTIG_RO: int
STRIDED: int
STRIDED_RO: int
RECORDS: int
RECORDS_RO: int
FULL: int
FULL_RO: int
READ: int
WRITE: int
SIMPLE = 0
WRITABLE = 1
FORMAT = 4
ND = 8
STRIDES = 24
C_CONTIGUOUS = 56
F_CONTIGUOUS = 88
ANY_CONTIGUOUS = 152
INDIRECT = 280
CONTIG = 9
CONTIG_RO = 8
STRIDED = 25
STRIDED_RO = 24
RECORDS = 29
RECORDS_RO = 28
FULL = 285
FULL_RO = 284
READ = 256
WRITE = 512

View File

@@ -11,8 +11,8 @@ if sys.version_info < (3, 9):
__all__ += ["readPlist", "writePlist", "readPlistFromBytes", "writePlistToBytes", "Data"]
class PlistFormat(Enum):
FMT_XML: int
FMT_BINARY: int
FMT_XML = 1
FMT_BINARY = 2
FMT_XML = PlistFormat.FMT_XML
FMT_BINARY = PlistFormat.FMT_BINARY

View File

@@ -14,15 +14,15 @@ else:
_Selector: TypeAlias = str | float | int
class SortKey(StrEnum):
CALLS: str
CUMULATIVE: str
FILENAME: str
LINE: str
NAME: str
NFL: str
PCALLS: str
STDNAME: str
TIME: str
CALLS = "calls"
CUMULATIVE = "cumulative"
FILENAME = "filename"
LINE = "line"
NAME = "name"
NFL = "nfl"
PCALLS = "pcalls"
STDNAME = "stdname"
TIME = "time"
if sys.version_info >= (3, 9):
from dataclasses import dataclass

View File

@@ -12,9 +12,9 @@ class PyCompileError(Exception):
def __init__(self, exc_type: type[BaseException], exc_value: BaseException, file: str, msg: str = "") -> None: ...
class PycInvalidationMode(enum.Enum):
TIMESTAMP: int
CHECKED_HASH: int
UNCHECKED_HASH: int
TIMESTAMP = 1
CHECKED_HASH = 2
UNCHECKED_HASH = 3
def _get_default_invalidation_mode() -> PycInvalidationMode: ...
def compile(

View File

@@ -9,57 +9,57 @@ from typing_extensions import Never, TypeAlias
NSIG: int
class Signals(IntEnum):
SIGABRT: int
SIGFPE: int
SIGILL: int
SIGINT: int
SIGSEGV: int
SIGTERM: int
SIGABRT = 6
SIGFPE = 8
SIGILL = 4
SIGINT = 2
SIGSEGV = 11
SIGTERM = 15
if sys.platform == "win32":
SIGBREAK: int
CTRL_C_EVENT: int
CTRL_BREAK_EVENT: int
SIGBREAK = 21
CTRL_C_EVENT = 0
CTRL_BREAK_EVENT = 1
else:
SIGALRM: int
SIGBUS: int
SIGCHLD: int
SIGCONT: int
SIGHUP: int
SIGIO: int
SIGIOT: int
SIGKILL: int
SIGPIPE: int
SIGPROF: int
SIGQUIT: int
SIGSTOP: int
SIGSYS: int
SIGTRAP: int
SIGTSTP: int
SIGTTIN: int
SIGTTOU: int
SIGURG: int
SIGUSR1: int
SIGUSR2: int
SIGVTALRM: int
SIGWINCH: int
SIGXCPU: int
SIGXFSZ: int
SIGALRM = 14
SIGBUS = 7
SIGCHLD = 17
SIGCONT = 18
SIGHUP = 1
SIGIO = 29
SIGIOT = 6
SIGKILL = 9
SIGPIPE = 13
SIGPROF = 27
SIGQUIT = 3
SIGSTOP = 19
SIGSYS = 31
SIGTRAP = 5
SIGTSTP = 20
SIGTTIN = 21
SIGTTOU = 22
SIGURG = 23
SIGUSR1 = 10
SIGUSR2 = 12
SIGVTALRM = 26
SIGWINCH = 28
SIGXCPU = 24
SIGXFSZ = 25
if sys.platform != "linux":
SIGEMT: int
SIGINFO: int
SIGEMT = 7
SIGINFO = 29
if sys.platform != "darwin":
SIGCLD: int
SIGPOLL: int
SIGPWR: int
SIGRTMAX: int
SIGRTMIN: int
SIGCLD = 17
SIGPOLL = 29
SIGPWR = 30
SIGRTMAX = 64
SIGRTMIN = 34
if sys.version_info >= (3, 11):
SIGSTKFLT: int
SIGSTKFLT = 16
class Handlers(IntEnum):
SIG_DFL: int
SIG_IGN: int
SIG_DFL = 0
SIG_IGN = 1
SIG_DFL: Handlers
SIG_IGN: Handlers
@@ -123,9 +123,9 @@ else:
ITIMER_VIRTUAL: int
class Sigmasks(IntEnum):
SIG_BLOCK: int
SIG_UNBLOCK: int
SIG_SETMASK: int
SIG_BLOCK = 0
SIG_UNBLOCK = 1
SIG_SETMASK = 2
SIG_BLOCK = Sigmasks.SIG_BLOCK
SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK

View File

@@ -480,51 +480,51 @@ EAGAIN: int
EWOULDBLOCK: int
class AddressFamily(IntEnum):
AF_INET: int
AF_INET6: int
AF_APPLETALK: int
AF_DECnet: int
AF_IPX: int
AF_SNA: int
AF_UNSPEC: int
AF_INET = 2
AF_INET6 = 10
AF_APPLETALK = 5
AF_DECnet = ...
AF_IPX = 4
AF_SNA = 22
AF_UNSPEC = 0
if sys.platform != "darwin":
AF_IRDA: int
AF_IRDA = 23
if sys.platform != "win32":
AF_ROUTE: int
AF_SYSTEM: int
AF_UNIX: int
AF_ROUTE = 16
AF_SYSTEM = 32
AF_UNIX = 1
if sys.platform != "win32" and sys.platform != "darwin":
AF_AAL5: int
AF_ASH: int
AF_ATMPVC: int
AF_ATMSVC: int
AF_AX25: int
AF_BRIDGE: int
AF_ECONET: int
AF_KEY: int
AF_LLC: int
AF_NETBEUI: int
AF_NETROM: int
AF_PPPOX: int
AF_ROSE: int
AF_SECURITY: int
AF_WANPIPE: int
AF_X25: int
AF_AAL5 = ...
AF_ASH = 18
AF_ATMPVC = 8
AF_ATMSVC = 20
AF_AX25 = 3
AF_BRIDGE = 7
AF_ECONET = 19
AF_KEY = 15
AF_LLC = 26
AF_NETBEUI = 13
AF_NETROM = 6
AF_PPPOX = 24
AF_ROSE = 11
AF_SECURITY = 14
AF_WANPIPE = 25
AF_X25 = 9
if sys.platform == "linux":
AF_CAN: int
AF_PACKET: int
AF_RDS: int
AF_TIPC: int
AF_ALG: int
AF_NETLINK: int
AF_VSOCK: int
AF_QIPCRTR: int
AF_CAN = 29
AF_PACKET = 17
AF_RDS = 21
AF_TIPC = 30
AF_ALG = 38
AF_NETLINK = 16
AF_VSOCK = 40
AF_QIPCRTR = 42
if sys.platform != "win32" or sys.version_info >= (3, 9):
AF_LINK: int
AF_LINK = 33
if sys.platform != "darwin":
AF_BLUETOOTH: int
AF_BLUETOOTH = 32
if sys.platform == "win32" and sys.version_info >= (3, 12):
AF_HYPERV: int
AF_HYPERV = 34
AF_INET = AddressFamily.AF_INET
AF_INET6 = AddressFamily.AF_INET6
@@ -579,14 +579,14 @@ if sys.platform == "win32" and sys.version_info >= (3, 12):
AF_HYPERV = AddressFamily.AF_HYPERV
class SocketKind(IntEnum):
SOCK_STREAM: int
SOCK_DGRAM: int
SOCK_RAW: int
SOCK_RDM: int
SOCK_SEQPACKET: int
SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5
if sys.platform == "linux":
SOCK_CLOEXEC: int
SOCK_NONBLOCK: int
SOCK_CLOEXEC = 524288
SOCK_NONBLOCK = 2048
SOCK_STREAM = SocketKind.SOCK_STREAM
SOCK_DGRAM = SocketKind.SOCK_DGRAM
@@ -598,32 +598,32 @@ if sys.platform == "linux":
SOCK_NONBLOCK = SocketKind.SOCK_NONBLOCK
class MsgFlag(IntFlag):
MSG_CTRUNC: int
MSG_DONTROUTE: int
MSG_OOB: int
MSG_PEEK: int
MSG_TRUNC: int
MSG_WAITALL: int
MSG_CTRUNC = 8
MSG_DONTROUTE = 4
MSG_OOB = 1
MSG_PEEK = 2
MSG_TRUNC = 32
MSG_WAITALL = 256
if sys.platform != "darwin":
MSG_BCAST: int
MSG_MCAST: int
MSG_ERRQUEUE: int
MSG_BCAST = 1024
MSG_MCAST = 2048
MSG_ERRQUEUE = 8192
if sys.platform != "win32" and sys.platform != "darwin":
MSG_BTAG: int
MSG_CMSG_CLOEXEC: int
MSG_CONFIRM: int
MSG_ETAG: int
MSG_FASTOPEN: int
MSG_MORE: int
MSG_NOTIFICATION: int
MSG_BTAG = ...
MSG_CMSG_CLOEXEC = 1073741821
MSG_CONFIRM = 2048
MSG_ETAG = ...
MSG_FASTOPEN = 536870912
MSG_MORE = 32768
MSG_NOTIFICATION = ...
if sys.platform != "win32":
MSG_DONTWAIT: int
MSG_EOF: int
MSG_EOR: int
MSG_NOSIGNAL: int # sometimes this exists on darwin, sometimes not
MSG_DONTWAIT = 64
MSG_EOF = 256
MSG_EOR = 128
MSG_NOSIGNAL = 16384 # sometimes this exists on darwin, sometimes not
MSG_CTRUNC = MsgFlag.MSG_CTRUNC
MSG_DONTROUTE = MsgFlag.MSG_DONTROUTE
@@ -653,17 +653,17 @@ if sys.platform != "win32" and sys.platform != "darwin":
MSG_NOTIFICATION = MsgFlag.MSG_NOTIFICATION
class AddressInfo(IntFlag):
AI_ADDRCONFIG: int
AI_ALL: int
AI_CANONNAME: int
AI_NUMERICHOST: int
AI_NUMERICSERV: int
AI_PASSIVE: int
AI_V4MAPPED: int
AI_ADDRCONFIG = 32
AI_ALL = 16
AI_CANONNAME = 2
AI_NUMERICHOST = 4
AI_NUMERICSERV = 1024
AI_PASSIVE = 1
AI_V4MAPPED = 8
if sys.platform != "win32":
AI_DEFAULT: int
AI_MASK: int
AI_V4MAPPED_CFG: int
AI_DEFAULT = 1536
AI_MASK = 5127
AI_V4MAPPED_CFG = 512
AI_ADDRCONFIG = AddressInfo.AI_ADDRCONFIG
AI_ALL = AddressInfo.AI_ALL

View File

@@ -138,23 +138,23 @@ if sys.platform == "win32":
def enum_crls(store_name: str) -> _EnumRetType: ...
class VerifyMode(enum.IntEnum):
CERT_NONE: int
CERT_OPTIONAL: int
CERT_REQUIRED: int
CERT_NONE = 0
CERT_OPTIONAL = 1
CERT_REQUIRED = 2
CERT_NONE: VerifyMode
CERT_OPTIONAL: VerifyMode
CERT_REQUIRED: VerifyMode
class VerifyFlags(enum.IntFlag):
VERIFY_DEFAULT: int
VERIFY_CRL_CHECK_LEAF: int
VERIFY_CRL_CHECK_CHAIN: int
VERIFY_X509_STRICT: int
VERIFY_X509_TRUSTED_FIRST: int
VERIFY_DEFAULT = 0
VERIFY_CRL_CHECK_LEAF = 4
VERIFY_CRL_CHECK_CHAIN = 12
VERIFY_X509_STRICT = 32
VERIFY_X509_TRUSTED_FIRST = 32768
if sys.version_info >= (3, 10):
VERIFY_ALLOW_PROXY_CERTS: int
VERIFY_X509_PARTIAL_CHAIN: int
VERIFY_ALLOW_PROXY_CERTS = 64
VERIFY_X509_PARTIAL_CHAIN = 524288
VERIFY_DEFAULT: VerifyFlags
VERIFY_CRL_CHECK_LEAF: VerifyFlags
@@ -167,15 +167,15 @@ if sys.version_info >= (3, 10):
VERIFY_X509_PARTIAL_CHAIN: VerifyFlags
class _SSLMethod(enum.IntEnum):
PROTOCOL_SSLv23: int
PROTOCOL_SSLv2: int
PROTOCOL_SSLv3: int
PROTOCOL_TLSv1: int
PROTOCOL_TLSv1_1: int
PROTOCOL_TLSv1_2: int
PROTOCOL_TLS: int
PROTOCOL_TLS_CLIENT: int
PROTOCOL_TLS_SERVER: int
PROTOCOL_SSLv23 = 2
PROTOCOL_SSLv2 = ...
PROTOCOL_SSLv3 = ...
PROTOCOL_TLSv1 = 3
PROTOCOL_TLSv1_1 = 4
PROTOCOL_TLSv1_2 = 5
PROTOCOL_TLS = 2
PROTOCOL_TLS_CLIENT = 16
PROTOCOL_TLS_SERVER = 17
PROTOCOL_SSLv23: _SSLMethod
PROTOCOL_SSLv2: _SSLMethod
@@ -188,25 +188,25 @@ PROTOCOL_TLS_CLIENT: _SSLMethod
PROTOCOL_TLS_SERVER: _SSLMethod
class Options(enum.IntFlag):
OP_ALL: int
OP_NO_SSLv2: int
OP_NO_SSLv3: int
OP_NO_TLSv1: int
OP_NO_TLSv1_1: int
OP_NO_TLSv1_2: int
OP_NO_TLSv1_3: int
OP_CIPHER_SERVER_PREFERENCE: int
OP_SINGLE_DH_USE: int
OP_SINGLE_ECDH_USE: int
OP_NO_COMPRESSION: int
OP_NO_TICKET: int
OP_NO_RENEGOTIATION: int
OP_ENABLE_MIDDLEBOX_COMPAT: int
OP_ALL = 2147483728
OP_NO_SSLv2 = 0
OP_NO_SSLv3 = 33554432
OP_NO_TLSv1 = 67108864
OP_NO_TLSv1_1 = 268435456
OP_NO_TLSv1_2 = 134217728
OP_NO_TLSv1_3 = 536870912
OP_CIPHER_SERVER_PREFERENCE = 4194304
OP_SINGLE_DH_USE = 0
OP_SINGLE_ECDH_USE = 0
OP_NO_COMPRESSION = 131072
OP_NO_TICKET = 16384
OP_NO_RENEGOTIATION = 1073741824
OP_ENABLE_MIDDLEBOX_COMPAT = 1048576
if sys.version_info >= (3, 12):
OP_LEGACY_SERVER_CONNECT: int
OP_ENABLE_KTLS: int
OP_LEGACY_SERVER_CONNECT = 4
OP_ENABLE_KTLS = 8
if sys.version_info >= (3, 11) or sys.platform == "linux":
OP_IGNORE_UNEXPECTED_EOF: int
OP_IGNORE_UNEXPECTED_EOF = 128
OP_ALL: Options
OP_NO_SSLv2: Options
@@ -246,33 +246,33 @@ OPENSSL_VERSION_INFO: tuple[int, int, int, int, int]
OPENSSL_VERSION_NUMBER: int
class AlertDescription(enum.IntEnum):
ALERT_DESCRIPTION_ACCESS_DENIED: int
ALERT_DESCRIPTION_BAD_CERTIFICATE: int
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE: int
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE: int
ALERT_DESCRIPTION_BAD_RECORD_MAC: int
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED: int
ALERT_DESCRIPTION_CERTIFICATE_REVOKED: int
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN: int
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE: int
ALERT_DESCRIPTION_CLOSE_NOTIFY: int
ALERT_DESCRIPTION_DECODE_ERROR: int
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE: int
ALERT_DESCRIPTION_DECRYPT_ERROR: int
ALERT_DESCRIPTION_HANDSHAKE_FAILURE: int
ALERT_DESCRIPTION_ILLEGAL_PARAMETER: int
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY: int
ALERT_DESCRIPTION_INTERNAL_ERROR: int
ALERT_DESCRIPTION_NO_RENEGOTIATION: int
ALERT_DESCRIPTION_PROTOCOL_VERSION: int
ALERT_DESCRIPTION_RECORD_OVERFLOW: int
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE: int
ALERT_DESCRIPTION_UNKNOWN_CA: int
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY: int
ALERT_DESCRIPTION_UNRECOGNIZED_NAME: int
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: int
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: int
ALERT_DESCRIPTION_USER_CANCELLED: int
ALERT_DESCRIPTION_ACCESS_DENIED = 49
ALERT_DESCRIPTION_BAD_CERTIFICATE = 42
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE = 114
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE = 113
ALERT_DESCRIPTION_BAD_RECORD_MAC = 20
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED = 45
ALERT_DESCRIPTION_CERTIFICATE_REVOKED = 44
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN = 46
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE = 111
ALERT_DESCRIPTION_CLOSE_NOTIFY = 0
ALERT_DESCRIPTION_DECODE_ERROR = 50
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE = 30
ALERT_DESCRIPTION_DECRYPT_ERROR = 51
ALERT_DESCRIPTION_HANDSHAKE_FAILURE = 40
ALERT_DESCRIPTION_ILLEGAL_PARAMETER = 47
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY = 71
ALERT_DESCRIPTION_INTERNAL_ERROR = 80
ALERT_DESCRIPTION_NO_RENEGOTIATION = 100
ALERT_DESCRIPTION_PROTOCOL_VERSION = 70
ALERT_DESCRIPTION_RECORD_OVERFLOW = 22
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE = 10
ALERT_DESCRIPTION_UNKNOWN_CA = 48
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY = 115
ALERT_DESCRIPTION_UNRECOGNIZED_NAME = 112
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE = 43
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION = 110
ALERT_DESCRIPTION_USER_CANCELLED = 90
ALERT_DESCRIPTION_HANDSHAKE_FAILURE: AlertDescription
ALERT_DESCRIPTION_INTERNAL_ERROR: AlertDescription
@@ -316,8 +316,8 @@ class _ASN1Object(_ASN1ObjectBase):
def fromname(cls, name: str) -> Self: ...
class Purpose(_ASN1Object, enum.Enum):
SERVER_AUTH: _ASN1Object
CLIENT_AUTH: _ASN1Object
SERVER_AUTH = (129, "serverAuth", "TLS Web Server Authentication", "1.3.6.1.5.5.7.3.2") # pyright: ignore[reportCallIssue]
CLIENT_AUTH = (130, "clientAuth", "TLS Web Client Authentication", "1.3.6.1.5.5.7.3.1") # pyright: ignore[reportCallIssue]
class SSLSocket(socket.socket):
context: SSLContext
@@ -371,13 +371,13 @@ class SSLSocket(socket.socket):
def get_unverified_chain(self) -> list[bytes]: ...
class TLSVersion(enum.IntEnum):
MINIMUM_SUPPORTED: int
MAXIMUM_SUPPORTED: int
SSLv3: int
TLSv1: int
TLSv1_1: int
TLSv1_2: int
TLSv1_3: int
MINIMUM_SUPPORTED = -2
MAXIMUM_SUPPORTED = -1
SSLv3 = 768
TLSv1 = 769
TLSv1_1 = 770
TLSv1_2 = 771
TLSv1_3 = 772
class SSLContext:
check_hostname: bool
@@ -506,15 +506,15 @@ class SSLSession:
def __eq__(self, value: object, /) -> bool: ...
class SSLErrorNumber(enum.IntEnum):
SSL_ERROR_EOF: int
SSL_ERROR_INVALID_ERROR_CODE: int
SSL_ERROR_SSL: int
SSL_ERROR_SYSCALL: int
SSL_ERROR_WANT_CONNECT: int
SSL_ERROR_WANT_READ: int
SSL_ERROR_WANT_WRITE: int
SSL_ERROR_WANT_X509_LOOKUP: int
SSL_ERROR_ZERO_RETURN: int
SSL_ERROR_EOF = 8
SSL_ERROR_INVALID_ERROR_CODE = 10
SSL_ERROR_SSL = 1
SSL_ERROR_SYSCALL = 5
SSL_ERROR_WANT_CONNECT = 7
SSL_ERROR_WANT_READ = 2
SSL_ERROR_WANT_WRITE = 3
SSL_ERROR_WANT_X509_LOOKUP = 4
SSL_ERROR_ZERO_RETURN = 6
SSL_ERROR_EOF: SSLErrorNumber # undocumented
SSL_ERROR_INVALID_ERROR_CODE: SSLErrorNumber # undocumented

View File

@@ -194,45 +194,45 @@ if sys.version_info >= (3, 11):
serial: int
class EventType(StrEnum):
Activate: str
ButtonPress: str
Activate = "36"
ButtonPress = "4"
Button = ButtonPress
ButtonRelease: str
Circulate: str
CirculateRequest: str
ClientMessage: str
Colormap: str
Configure: str
ConfigureRequest: str
Create: str
Deactivate: str
Destroy: str
Enter: str
Expose: str
FocusIn: str
FocusOut: str
GraphicsExpose: str
Gravity: str
KeyPress: str
Key = KeyPress
KeyRelease: str
Keymap: str
Leave: str
Map: str
MapRequest: str
Mapping: str
Motion: str
MouseWheel: str
NoExpose: str
Property: str
Reparent: str
ResizeRequest: str
Selection: str
SelectionClear: str
SelectionRequest: str
Unmap: str
VirtualEvent: str
Visibility: str
ButtonRelease = "5"
Circulate = "26"
CirculateRequest = "27"
ClientMessage = "33"
Colormap = "32"
Configure = "22"
ConfigureRequest = "23"
Create = "16"
Deactivate = "37"
Destroy = "17"
Enter = "7"
Expose = "12"
FocusIn = "9"
FocusOut = "10"
GraphicsExpose = "13"
Gravity = "24"
KeyPress = "2"
Key = "2"
KeyRelease = "3"
Keymap = "11"
Leave = "8"
Map = "19"
MapRequest = "20"
Mapping = "34"
Motion = "6"
MouseWheel = "38"
NoExpose = "14"
Property = "28"
Reparent = "21"
ResizeRequest = "25"
Selection = "31"
SelectionClear = "29"
SelectionRequest = "30"
Unmap = "18"
VirtualEvent = "35"
Visibility = "15"
_W = TypeVar("_W", bound=Misc)
# Events considered covariant because you should never assign to event.widget.

View File

@@ -7,9 +7,9 @@ from typing_extensions import TypeAlias
_FieldsType: TypeAlias = tuple[int, int, int, int, int, int]
class SafeUUID(Enum):
safe: int
unsafe: int
unknown: None
safe = 0
unsafe = -1
unknown = None
class UUID:
def __init__(