From 17f1c4628a93451ed1872d58739f67a8b1e593c6 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 22 Apr 2024 07:10:59 -0700 Subject: [PATCH] Add precise values for enum members where possible (#11299) Co-authored-by: Jelle Zijlstra Co-authored-by: Alex Waygood --- .flake8 | 4 + stdlib/asyncio/constants.pyi | 6 +- stdlib/asyncio/locks.pyi | 8 +- stdlib/asyncio/sslproto.pyi | 18 +- stdlib/http/__init__.pyi | 136 ++-- stdlib/inspect.pyi | 48 +- stdlib/plistlib.pyi | 4 +- stdlib/pstats.pyi | 18 +- stdlib/py_compile.pyi | 6 +- stdlib/signal.pyi | 92 +-- stdlib/socket.pyi | 150 ++-- stdlib/ssl.pyi | 162 ++--- stdlib/tkinter/__init__.pyi | 76 +- stdlib/uuid.pyi | 6 +- stubs/Pillow/PIL/BlpImagePlugin.pyi | 14 +- stubs/Pillow/PIL/ExifTags.pyi | 662 +++++++++--------- stubs/Pillow/PIL/FtexImagePlugin.pyi | 4 +- stubs/Pillow/PIL/Image.pyi | 56 +- stubs/Pillow/PIL/ImageCms.pyi | 14 +- stubs/Pillow/PIL/ImageFont.pyi | 4 +- stubs/Pillow/PIL/PngImagePlugin.pyi | 10 +- .../aws_xray_sdk/core/sampling/reservoir.pyi | 6 +- stubs/fpdf2/fpdf/enums.pyi | 326 ++++----- .../client/flux_csv_parser.pyi | 10 +- .../influxdb_client/client/write_api.pyi | 6 +- stubs/pika/pika/delivery_mode.pyi | 4 +- stubs/pika/pika/exchange_type.pyi | 8 +- stubs/psutil/psutil/_common.pyi | 10 +- stubs/psutil/psutil/_pslinux.pyi | 8 +- stubs/psutil/psutil/_psutil_windows.pyi | 14 +- stubs/psutil/psutil/_pswindows.pyi | 20 +- stubs/pynput/pynput/keyboard/_base.pyi | 128 ++-- stubs/pynput/pynput/mouse/_base.pyi | 66 +- stubs/redis/redis/asyncio/connection.pyi | 2 +- stubs/regex/regex/_regex_core.pyi | 68 +- .../setuptools/command/editable_wheel.pyi | 6 +- 36 files changed, 1093 insertions(+), 1087 deletions(-) diff --git a/.flake8 b/.flake8 index cf6578d7bb11..88c704d12fe5 100644 --- a/.flake8 +++ b/.flake8 @@ -8,6 +8,10 @@ extend-ignore = Y090 per-file-ignores = # We should only need to noqa Y and F821 codes in .pyi files *.py: NQA + # Ignore Y052 in this file: there are loads of false positives + # due to the fact that flake8-pyi doesn't understand subclasses of `CoerciveEnum` + # as being enum classes + stubs/fpdf2/fpdf/enums.pyi: Y052 # Generated protobuf files: # Y021: Include docstrings # Y023: Alias typing as typing_extensions diff --git a/stdlib/asyncio/constants.pyi b/stdlib/asyncio/constants.pyi index 559cc02a0faa..7759a2844953 100644 --- a/stdlib/asyncio/constants.pyi +++ b/stdlib/asyncio/constants.pyi @@ -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 diff --git a/stdlib/asyncio/locks.pyi b/stdlib/asyncio/locks.pyi index 3aac34b6934f..0114aeb23329 100644 --- a/stdlib/asyncio/locks.pyi +++ b/stdlib/asyncio/locks.pyi @@ -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: ... diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index 04197c8d2978..e904d7395cdc 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -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]: ... diff --git a/stdlib/http/__init__.pyi b/stdlib/http/__init__.pyi index 2eee06fdaaa9..bb5737cc0481 100644 --- a/stdlib/http/__init__.pyi +++ b/stdlib/http/__init__.pyi @@ -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" diff --git a/stdlib/inspect.pyi b/stdlib/inspect.pyi index bb5ddc37c603..40288dd2b4e4 100644 --- a/stdlib/inspect.pyi +++ b/stdlib/inspect.pyi @@ -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 diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index f7912a784987..09637673ce21 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -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 diff --git a/stdlib/pstats.pyi b/stdlib/pstats.pyi index d1571fd94be5..83256b433035 100644 --- a/stdlib/pstats.pyi +++ b/stdlib/pstats.pyi @@ -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 diff --git a/stdlib/py_compile.pyi b/stdlib/py_compile.pyi index 81561a202883..334ce79b5dd0 100644 --- a/stdlib/py_compile.pyi +++ b/stdlib/py_compile.pyi @@ -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( diff --git a/stdlib/signal.pyi b/stdlib/signal.pyi index 663ee2fe7430..cbb7440b9147 100644 --- a/stdlib/signal.pyi +++ b/stdlib/signal.pyi @@ -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 diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index cdbd70533714..a309bac9370a 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -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 diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index 15d86372531a..81c68c69ec4e 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -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 diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 80bc56ef53f3..d8ce17535eab 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -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. diff --git a/stdlib/uuid.pyi b/stdlib/uuid.pyi index e1ea424f9680..1be7a5ef009f 100644 --- a/stdlib/uuid.pyi +++ b/stdlib/uuid.pyi @@ -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__( diff --git a/stubs/Pillow/PIL/BlpImagePlugin.pyi b/stubs/Pillow/PIL/BlpImagePlugin.pyi index eda4e0c6c86d..c69e465062ba 100644 --- a/stubs/Pillow/PIL/BlpImagePlugin.pyi +++ b/stubs/Pillow/PIL/BlpImagePlugin.pyi @@ -5,17 +5,17 @@ from typing import ClassVar, Literal from .ImageFile import ImageFile, PyDecoder, PyEncoder class Format(IntEnum): - JPEG: int + JPEG = 0 class Encoding(IntEnum): - UNCOMPRESSED: int - DXT: int - UNCOMPRESSED_RAW_BGRA: int + UNCOMPRESSED = 1 + DXT = 2 + UNCOMPRESSED_RAW_BGRA = 3 class AlphaEncoding(IntEnum): - DXT1: int - DXT3: int - DXT5: int + DXT1 = 0 + DXT3 = 1 + DXT5 = 7 def unpack_565(i): ... def decode_dxt1(data, alpha: bool = False): ... diff --git a/stubs/Pillow/PIL/ExifTags.pyi b/stubs/Pillow/PIL/ExifTags.pyi index 4b75919f447d..615ed585c095 100644 --- a/stubs/Pillow/PIL/ExifTags.pyi +++ b/stubs/Pillow/PIL/ExifTags.pyi @@ -2,346 +2,346 @@ from collections.abc import Mapping from enum import IntEnum class Base(IntEnum): - InteropIndex: int - ProcessingSoftware: int - NewSubfileType: int - SubfileType: int - ImageWidth: int - ImageLength: int - BitsPerSample: int - Compression: int - PhotometricInterpretation: int - Thresholding: int - CellWidth: int - CellLength: int - FillOrder: int - DocumentName: int - ImageDescription: int - Make: int - Model: int - StripOffsets: int - Orientation: int - SamplesPerPixel: int - RowsPerStrip: int - StripByteCounts: int - MinSampleValue: int - MaxSampleValue: int - XResolution: int - YResolution: int - PlanarConfiguration: int - PageName: int - FreeOffsets: int - FreeByteCounts: int - GrayResponseUnit: int - GrayResponseCurve: int - T4Options: int - T6Options: int - ResolutionUnit: int - PageNumber: int - TransferFunction: int - Software: int - DateTime: int - Artist: int - HostComputer: int - Predictor: int - WhitePoint: int - PrimaryChromaticities: int - ColorMap: int - HalftoneHints: int - TileWidth: int - TileLength: int - TileOffsets: int - TileByteCounts: int - SubIFDs: int - InkSet: int - InkNames: int - NumberOfInks: int - DotRange: int - TargetPrinter: int - ExtraSamples: int - SampleFormat: int - SMinSampleValue: int - SMaxSampleValue: int - TransferRange: int - ClipPath: int - XClipPathUnits: int - YClipPathUnits: int - Indexed: int - JPEGTables: int - OPIProxy: int - JPEGProc: int - JpegIFOffset: int - JpegIFByteCount: int - JpegRestartInterval: int - JpegLosslessPredictors: int - JpegPointTransforms: int - JpegQTables: int - JpegDCTables: int - JpegACTables: int - YCbCrCoefficients: int - YCbCrSubSampling: int - YCbCrPositioning: int - ReferenceBlackWhite: int - XMLPacket: int - RelatedImageFileFormat: int - RelatedImageWidth: int - RelatedImageLength: int - Rating: int - RatingPercent: int - ImageID: int - CFARepeatPatternDim: int - BatteryLevel: int - Copyright: int - ExposureTime: int - FNumber: int - IPTCNAA: int - ImageResources: int - ExifOffset: int - InterColorProfile: int - ExposureProgram: int - SpectralSensitivity: int - GPSInfo: int - ISOSpeedRatings: int - OECF: int - Interlace: int - TimeZoneOffset: int - SelfTimerMode: int - SensitivityType: int - StandardOutputSensitivity: int - RecommendedExposureIndex: int - ISOSpeed: int - ISOSpeedLatitudeyyy: int - ISOSpeedLatitudezzz: int - ExifVersion: int - DateTimeOriginal: int - DateTimeDigitized: int - OffsetTime: int - OffsetTimeOriginal: int - OffsetTimeDigitized: int - ComponentsConfiguration: int - CompressedBitsPerPixel: int - ShutterSpeedValue: int - ApertureValue: int - BrightnessValue: int - ExposureBiasValue: int - MaxApertureValue: int - SubjectDistance: int - MeteringMode: int - LightSource: int - Flash: int - FocalLength: int - Noise: int - ImageNumber: int - SecurityClassification: int - ImageHistory: int - TIFFEPStandardID: int - MakerNote: int - UserComment: int - SubsecTime: int - SubsecTimeOriginal: int - SubsecTimeDigitized: int - AmbientTemperature: int - Humidity: int - Pressure: int - WaterDepth: int - Acceleration: int - CameraElevationAngle: int - XPTitle: int - XPComment: int - XPAuthor: int - XPKeywords: int - XPSubject: int - FlashPixVersion: int - ColorSpace: int - ExifImageWidth: int - ExifImageHeight: int - RelatedSoundFile: int - ExifInteroperabilityOffset: int - FlashEnergy: int - SpatialFrequencyResponse: int - FocalPlaneXResolution: int - FocalPlaneYResolution: int - FocalPlaneResolutionUnit: int - SubjectLocation: int - ExposureIndex: int - SensingMethod: int - FileSource: int - SceneType: int - CFAPattern: int - CustomRendered: int - ExposureMode: int - WhiteBalance: int - DigitalZoomRatio: int - FocalLengthIn35mmFilm: int - SceneCaptureType: int - GainControl: int - Contrast: int - Saturation: int - Sharpness: int - DeviceSettingDescription: int - SubjectDistanceRange: int - ImageUniqueID: int - CameraOwnerName: int - BodySerialNumber: int - LensSpecification: int - LensMake: int - LensModel: int - LensSerialNumber: int - CompositeImage: int - CompositeImageCount: int - CompositeImageExposureTimes: int - Gamma: int - PrintImageMatching: int - DNGVersion: int - DNGBackwardVersion: int - UniqueCameraModel: int - LocalizedCameraModel: int - CFAPlaneColor: int - CFALayout: int - LinearizationTable: int - BlackLevelRepeatDim: int - BlackLevel: int - BlackLevelDeltaH: int - BlackLevelDeltaV: int - WhiteLevel: int - DefaultScale: int - DefaultCropOrigin: int - DefaultCropSize: int - ColorMatrix1: int - ColorMatrix2: int - CameraCalibration1: int - CameraCalibration2: int - ReductionMatrix1: int - ReductionMatrix2: int - AnalogBalance: int - AsShotNeutral: int - AsShotWhiteXY: int - BaselineExposure: int - BaselineNoise: int - BaselineSharpness: int - BayerGreenSplit: int - LinearResponseLimit: int - CameraSerialNumber: int - LensInfo: int - ChromaBlurRadius: int - AntiAliasStrength: int - ShadowScale: int - DNGPrivateData: int - MakerNoteSafety: int - CalibrationIlluminant1: int - CalibrationIlluminant2: int - BestQualityScale: int - RawDataUniqueID: int - OriginalRawFileName: int - OriginalRawFileData: int - ActiveArea: int - MaskedAreas: int - AsShotICCProfile: int - AsShotPreProfileMatrix: int - CurrentICCProfile: int - CurrentPreProfileMatrix: int - ColorimetricReference: int - CameraCalibrationSignature: int - ProfileCalibrationSignature: int - AsShotProfileName: int - NoiseReductionApplied: int - ProfileName: int - ProfileHueSatMapDims: int - ProfileHueSatMapData1: int - ProfileHueSatMapData2: int - ProfileToneCurve: int - ProfileEmbedPolicy: int - ProfileCopyright: int - ForwardMatrix1: int - ForwardMatrix2: int - PreviewApplicationName: int - PreviewApplicationVersion: int - PreviewSettingsName: int - PreviewSettingsDigest: int - PreviewColorSpace: int - PreviewDateTime: int - RawImageDigest: int - OriginalRawFileDigest: int - SubTileBlockSize: int - RowInterleaveFactor: int - ProfileLookTableDims: int - ProfileLookTableData: int - OpcodeList1: int - OpcodeList2: int - OpcodeList3: int - NoiseProfile: int + InteropIndex = 0x0001 + ProcessingSoftware = 0x000B + NewSubfileType = 0x00FE + SubfileType = 0x00FF + ImageWidth = 0x0100 + ImageLength = 0x0101 + BitsPerSample = 0x0102 + Compression = 0x0103 + PhotometricInterpretation = 0x0106 + Thresholding = 0x0107 + CellWidth = 0x0108 + CellLength = 0x0109 + FillOrder = 0x010A + DocumentName = 0x010D + ImageDescription = 0x010E + Make = 0x010F + Model = 0x0110 + StripOffsets = 0x0111 + Orientation = 0x0112 + SamplesPerPixel = 0x0115 + RowsPerStrip = 0x0116 + StripByteCounts = 0x0117 + MinSampleValue = 0x0118 + MaxSampleValue = 0x0119 + XResolution = 0x011A + YResolution = 0x011B + PlanarConfiguration = 0x011C + PageName = 0x011D + FreeOffsets = 0x0120 + FreeByteCounts = 0x0121 + GrayResponseUnit = 0x0122 + GrayResponseCurve = 0x0123 + T4Options = 0x0124 + T6Options = 0x0125 + ResolutionUnit = 0x0128 + PageNumber = 0x0129 + TransferFunction = 0x012D + Software = 0x0131 + DateTime = 0x0132 + Artist = 0x013B + HostComputer = 0x013C + Predictor = 0x013D + WhitePoint = 0x013E + PrimaryChromaticities = 0x013F + ColorMap = 0x0140 + HalftoneHints = 0x0141 + TileWidth = 0x0142 + TileLength = 0x0143 + TileOffsets = 0x0144 + TileByteCounts = 0x0145 + SubIFDs = 0x014A + InkSet = 0x014C + InkNames = 0x014D + NumberOfInks = 0x014E + DotRange = 0x0150 + TargetPrinter = 0x0151 + ExtraSamples = 0x0152 + SampleFormat = 0x0153 + SMinSampleValue = 0x0154 + SMaxSampleValue = 0x0155 + TransferRange = 0x0156 + ClipPath = 0x0157 + XClipPathUnits = 0x0158 + YClipPathUnits = 0x0159 + Indexed = 0x015A + JPEGTables = 0x015B + OPIProxy = 0x015F + JPEGProc = 0x0200 + JpegIFOffset = 0x0201 + JpegIFByteCount = 0x0202 + JpegRestartInterval = 0x0203 + JpegLosslessPredictors = 0x0205 + JpegPointTransforms = 0x0206 + JpegQTables = 0x0207 + JpegDCTables = 0x0208 + JpegACTables = 0x0209 + YCbCrCoefficients = 0x0211 + YCbCrSubSampling = 0x0212 + YCbCrPositioning = 0x0213 + ReferenceBlackWhite = 0x0214 + XMLPacket = 0x02BC + RelatedImageFileFormat = 0x1000 + RelatedImageWidth = 0x1001 + RelatedImageLength = 0x1002 + Rating = 0x4746 + RatingPercent = 0x4749 + ImageID = 0x800D + CFARepeatPatternDim = 0x828D + BatteryLevel = 0x828F + Copyright = 0x8298 + ExposureTime = 0x829A + FNumber = 0x829D + IPTCNAA = 0x83BB + ImageResources = 0x8649 + ExifOffset = 0x8769 + InterColorProfile = 0x8773 + ExposureProgram = 0x8822 + SpectralSensitivity = 0x8824 + GPSInfo = 0x8825 + ISOSpeedRatings = 0x8827 + OECF = 0x8828 + Interlace = 0x8829 + TimeZoneOffset = 0x882A + SelfTimerMode = 0x882B + SensitivityType = 0x8830 + StandardOutputSensitivity = 0x8831 + RecommendedExposureIndex = 0x8832 + ISOSpeed = 0x8833 + ISOSpeedLatitudeyyy = 0x8834 + ISOSpeedLatitudezzz = 0x8835 + ExifVersion = 0x9000 + DateTimeOriginal = 0x9003 + DateTimeDigitized = 0x9004 + OffsetTime = 0x9010 + OffsetTimeOriginal = 0x9011 + OffsetTimeDigitized = 0x9012 + ComponentsConfiguration = 0x9101 + CompressedBitsPerPixel = 0x9102 + ShutterSpeedValue = 0x9201 + ApertureValue = 0x9202 + BrightnessValue = 0x9203 + ExposureBiasValue = 0x9204 + MaxApertureValue = 0x9205 + SubjectDistance = 0x9206 + MeteringMode = 0x9207 + LightSource = 0x9208 + Flash = 0x9209 + FocalLength = 0x920A + Noise = 0x920D + ImageNumber = 0x9211 + SecurityClassification = 0x9212 + ImageHistory = 0x9213 + TIFFEPStandardID = 0x9216 + MakerNote = 0x927C + UserComment = 0x9286 + SubsecTime = 0x9290 + SubsecTimeOriginal = 0x9291 + SubsecTimeDigitized = 0x9292 + AmbientTemperature = 0x9400 + Humidity = 0x9401 + Pressure = 0x9402 + WaterDepth = 0x9403 + Acceleration = 0x9404 + CameraElevationAngle = 0x9405 + XPTitle = 0x9C9B + XPComment = 0x9C9C + XPAuthor = 0x9C9D + XPKeywords = 0x9C9E + XPSubject = 0x9C9F + FlashPixVersion = 0xA000 + ColorSpace = 0xA001 + ExifImageWidth = 0xA002 + ExifImageHeight = 0xA003 + RelatedSoundFile = 0xA004 + ExifInteroperabilityOffset = 0xA005 + FlashEnergy = 0xA20B + SpatialFrequencyResponse = 0xA20C + FocalPlaneXResolution = 0xA20E + FocalPlaneYResolution = 0xA20F + FocalPlaneResolutionUnit = 0xA210 + SubjectLocation = 0xA214 + ExposureIndex = 0xA215 + SensingMethod = 0xA217 + FileSource = 0xA300 + SceneType = 0xA301 + CFAPattern = 0xA302 + CustomRendered = 0xA401 + ExposureMode = 0xA402 + WhiteBalance = 0xA403 + DigitalZoomRatio = 0xA404 + FocalLengthIn35mmFilm = 0xA405 + SceneCaptureType = 0xA406 + GainControl = 0xA407 + Contrast = 0xA408 + Saturation = 0xA409 + Sharpness = 0xA40A + DeviceSettingDescription = 0xA40B + SubjectDistanceRange = 0xA40C + ImageUniqueID = 0xA420 + CameraOwnerName = 0xA430 + BodySerialNumber = 0xA431 + LensSpecification = 0xA432 + LensMake = 0xA433 + LensModel = 0xA434 + LensSerialNumber = 0xA435 + CompositeImage = 0xA460 + CompositeImageCount = 0xA461 + CompositeImageExposureTimes = 0xA462 + Gamma = 0xA500 + PrintImageMatching = 0xC4A5 + DNGVersion = 0xC612 + DNGBackwardVersion = 0xC613 + UniqueCameraModel = 0xC614 + LocalizedCameraModel = 0xC615 + CFAPlaneColor = 0xC616 + CFALayout = 0xC617 + LinearizationTable = 0xC618 + BlackLevelRepeatDim = 0xC619 + BlackLevel = 0xC61A + BlackLevelDeltaH = 0xC61B + BlackLevelDeltaV = 0xC61C + WhiteLevel = 0xC61D + DefaultScale = 0xC61E + DefaultCropOrigin = 0xC61F + DefaultCropSize = 0xC620 + ColorMatrix1 = 0xC621 + ColorMatrix2 = 0xC622 + CameraCalibration1 = 0xC623 + CameraCalibration2 = 0xC624 + ReductionMatrix1 = 0xC625 + ReductionMatrix2 = 0xC626 + AnalogBalance = 0xC627 + AsShotNeutral = 0xC628 + AsShotWhiteXY = 0xC629 + BaselineExposure = 0xC62A + BaselineNoise = 0xC62B + BaselineSharpness = 0xC62C + BayerGreenSplit = 0xC62D + LinearResponseLimit = 0xC62E + CameraSerialNumber = 0xC62F + LensInfo = 0xC630 + ChromaBlurRadius = 0xC631 + AntiAliasStrength = 0xC632 + ShadowScale = 0xC633 + DNGPrivateData = 0xC634 + MakerNoteSafety = 0xC635 + CalibrationIlluminant1 = 0xC65A + CalibrationIlluminant2 = 0xC65B + BestQualityScale = 0xC65C + RawDataUniqueID = 0xC65D + OriginalRawFileName = 0xC68B + OriginalRawFileData = 0xC68C + ActiveArea = 0xC68D + MaskedAreas = 0xC68E + AsShotICCProfile = 0xC68F + AsShotPreProfileMatrix = 0xC690 + CurrentICCProfile = 0xC691 + CurrentPreProfileMatrix = 0xC692 + ColorimetricReference = 0xC6BF + CameraCalibrationSignature = 0xC6F3 + ProfileCalibrationSignature = 0xC6F4 + AsShotProfileName = 0xC6F6 + NoiseReductionApplied = 0xC6F7 + ProfileName = 0xC6F8 + ProfileHueSatMapDims = 0xC6F9 + ProfileHueSatMapData1 = 0xC6FA + ProfileHueSatMapData2 = 0xC6FB + ProfileToneCurve = 0xC6FC + ProfileEmbedPolicy = 0xC6FD + ProfileCopyright = 0xC6FE + ForwardMatrix1 = 0xC714 + ForwardMatrix2 = 0xC715 + PreviewApplicationName = 0xC716 + PreviewApplicationVersion = 0xC717 + PreviewSettingsName = 0xC718 + PreviewSettingsDigest = 0xC719 + PreviewColorSpace = 0xC71A + PreviewDateTime = 0xC71B + RawImageDigest = 0xC71C + OriginalRawFileDigest = 0xC71D + SubTileBlockSize = 0xC71E + RowInterleaveFactor = 0xC71F + ProfileLookTableDims = 0xC725 + ProfileLookTableData = 0xC726 + OpcodeList1 = 0xC740 + OpcodeList2 = 0xC741 + OpcodeList3 = 0xC74E + NoiseProfile = 0xC761 TAGS: Mapping[int, str] class GPS(IntEnum): - GPSVersionID: int - GPSLatitudeRef: int - GPSLatitude: int - GPSLongitudeRef: int - GPSLongitude: int - GPSAltitudeRef: int - GPSAltitude: int - GPSTimeStamp: int - GPSSatellites: int - GPSStatus: int - GPSMeasureMode: int - GPSDOP: int - GPSSpeedRef: int - GPSSpeed: int - GPSTrackRef: int - GPSTrack: int - GPSImgDirectionRef: int - GPSImgDirection: int - GPSMapDatum: int - GPSDestLatitudeRef: int - GPSDestLatitude: int - GPSDestLongitudeRef: int - GPSDestLongitude: int - GPSDestBearingRef: int - GPSDestBearing: int - GPSDestDistanceRef: int - GPSDestDistance: int - GPSProcessingMethod: int - GPSAreaInformation: int - GPSDateStamp: int - GPSDifferential: int - GPSHPositioningError: int + GPSVersionID = 0 + GPSLatitudeRef = 1 + GPSLatitude = 2 + GPSLongitudeRef = 3 + GPSLongitude = 4 + GPSAltitudeRef = 5 + GPSAltitude = 6 + GPSTimeStamp = 7 + GPSSatellites = 8 + GPSStatus = 9 + GPSMeasureMode = 10 + GPSDOP = 11 + GPSSpeedRef = 12 + GPSSpeed = 13 + GPSTrackRef = 14 + GPSTrack = 15 + GPSImgDirectionRef = 16 + GPSImgDirection = 17 + GPSMapDatum = 18 + GPSDestLatitudeRef = 19 + GPSDestLatitude = 20 + GPSDestLongitudeRef = 21 + GPSDestLongitude = 22 + GPSDestBearingRef = 23 + GPSDestBearing = 24 + GPSDestDistanceRef = 25 + GPSDestDistance = 26 + GPSProcessingMethod = 27 + GPSAreaInformation = 28 + GPSDateStamp = 29 + GPSDifferential = 30 + GPSHPositioningError = 31 GPSTAGS: Mapping[int, str] class Interop(IntEnum): - InteropIndex: int - InteropVersion: int - RelatedImageFileFormat: int - RelatedImageWidth: int - RleatedImageHeight: int + InteropIndex = 1 + InteropVersion = 2 + RelatedImageFileFormat = 4096 + RelatedImageWidth = 4097 + RleatedImageHeight = 4098 class IFD(IntEnum): - Exif: int - GPSInfo: int - Makernote: int - Interop: int - IFD1: int + Exif = 34665 + GPSInfo = 34853 + Makernote = 37500 + Interop = 40965 + IFD1 = -1 class LightSource(IntEnum): - Unknown: int - Daylight: int - Fluorescent: int - Tungsten: int - Flash: int - Fine: int - Cloudy: int - Shade: int - DaylightFluorescent: int - DayWhiteFluorescent: int - CoolWhiteFluorescent: int - WhiteFluorescent: int - StandardLightA: int - StandardLightB: int - StandardLightC: int - D55: int - D65: int - D75: int - D50: int - ISO: int - Other: int + Unknown = 0 + Daylight = 1 + Fluorescent = 2 + Tungsten = 3 + Flash = 4 + Fine = 9 + Cloudy = 10 + Shade = 11 + DaylightFluorescent = 12 + DayWhiteFluorescent = 13 + CoolWhiteFluorescent = 14 + WhiteFluorescent = 15 + StandardLightA = 17 + StandardLightB = 18 + StandardLightC = 19 + D55 = 20 + D65 = 21 + D75 = 22 + D50 = 23 + ISO = 24 + Other = 255 diff --git a/stubs/Pillow/PIL/FtexImagePlugin.pyi b/stubs/Pillow/PIL/FtexImagePlugin.pyi index 43601e143643..d59c106775a2 100644 --- a/stubs/Pillow/PIL/FtexImagePlugin.pyi +++ b/stubs/Pillow/PIL/FtexImagePlugin.pyi @@ -6,8 +6,8 @@ from .ImageFile import ImageFile MAGIC: bytes class Format(IntEnum): - DXT1: int - UNCOMPRESSED: int + DXT1 = 0 + UNCOMPRESSED = 1 class FtexImageFile(ImageFile): format: ClassVar[Literal["FTEX"]] diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index d8d376a0a6ca..3fabab0b6475 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -56,13 +56,13 @@ USE_CFFI_ACCESS: bool def isImageType(t: object) -> TypeGuard[Image]: ... class Transpose(IntEnum): - FLIP_LEFT_RIGHT: Literal[0] - FLIP_TOP_BOTTOM: Literal[1] - ROTATE_90: Literal[2] - ROTATE_180: Literal[3] - ROTATE_270: Literal[4] - TRANSPOSE: Literal[5] - TRANSVERSE: Literal[6] + FLIP_LEFT_RIGHT = 0 + FLIP_TOP_BOTTOM = 1 + ROTATE_90 = 2 + ROTATE_180 = 3 + ROTATE_270 = 4 + TRANSPOSE = 5 + TRANSVERSE = 6 # All Transpose items FLIP_LEFT_RIGHT: Literal[0] @@ -74,11 +74,11 @@ TRANSPOSE: Literal[5] TRANSVERSE: Literal[6] class Transform(IntEnum): - AFFINE: Literal[0] - EXTENT: Literal[1] - PERSPECTIVE: Literal[2] - QUAD: Literal[3] - MESH: Literal[4] + AFFINE = 0 + EXTENT = 1 + PERSPECTIVE = 2 + QUAD = 3 + MESH = 4 # All Transform items AFFINE: Literal[0] @@ -88,12 +88,12 @@ QUAD: Literal[3] MESH: Literal[4] class Resampling(IntEnum): - NEAREST: Literal[0] - LANCZOS: Literal[1] - BILINEAR: Literal[2] - BICUBIC: Literal[3] - BOX: Literal[4] - HAMMING: Literal[5] + NEAREST = 0 + LANCZOS = 1 + BILINEAR = 2 + BICUBIC = 3 + BOX = 4 + HAMMING = 5 # All Resampling items NEAREST: Literal[0] @@ -104,10 +104,10 @@ BOX: Literal[4] HAMMING: Literal[5] class Dither(IntEnum): - NONE: Literal[0] - ORDERED: Literal[1] - RASTERIZE: Literal[2] - FLOYDSTEINBERG: Literal[3] + NONE = 0 + ORDERED = 1 + RASTERIZE = 2 + FLOYDSTEINBERG = 3 # All Dither items NONE: Literal[0] @@ -116,18 +116,18 @@ RASTERIZE: Literal[2] FLOYDSTEINBERG: Literal[3] class Palette(IntEnum): - WEB: Literal[0] - ADAPTIVE: Literal[1] + WEB = 0 + ADAPTIVE = 1 # All Palette items WEB: Literal[0] ADAPTIVE: Literal[1] class Quantize(IntEnum): - MEDIANCUT: Literal[0] - MAXCOVERAGE: Literal[1] - FASTOCTREE: Literal[2] - LIBIMAGEQUANT: Literal[3] + MEDIANCUT = 0 + MAXCOVERAGE = 1 + FASTOCTREE = 2 + LIBIMAGEQUANT = 3 # All Quantize items MEDIANCUT: Literal[0] diff --git a/stubs/Pillow/PIL/ImageCms.pyi b/stubs/Pillow/PIL/ImageCms.pyi index 6eb7101c4bd3..85ab9f70c42c 100644 --- a/stubs/Pillow/PIL/ImageCms.pyi +++ b/stubs/Pillow/PIL/ImageCms.pyi @@ -9,15 +9,15 @@ VERSION: str core: Incomplete class Intent(IntEnum): - PERCEPTUAL: int - RELATIVE_COLORIMETRIC: int - SATURATION: int - ABSOLUTE_COLORIMETRIC: int + PERCEPTUAL = 0 + RELATIVE_COLORIMETRIC = 1 + SATURATION = 2 + ABSOLUTE_COLORIMETRIC = 3 class Direction(IntEnum): - INPUT: int - OUTPUT: int - PROOF: int + INPUT = 0 + OUTPUT = 1 + PROOF = 2 FLAGS: Incomplete diff --git a/stubs/Pillow/PIL/ImageFont.pyi b/stubs/Pillow/PIL/ImageFont.pyi index 94d6ecf262e9..40d27609cd57 100644 --- a/stubs/Pillow/PIL/ImageFont.pyi +++ b/stubs/Pillow/PIL/ImageFont.pyi @@ -6,8 +6,8 @@ from typing import Final, Literal, Protocol from PIL.Image import Transpose class Layout(IntEnum): - BASIC: Literal[0] - RAQM: Literal[1] + BASIC = 0 + RAQM = 1 MAX_STRING_LENGTH: Final[int] = 1_000_000 diff --git a/stubs/Pillow/PIL/PngImagePlugin.pyi b/stubs/Pillow/PIL/PngImagePlugin.pyi index b510a259348b..777526876621 100644 --- a/stubs/Pillow/PIL/PngImagePlugin.pyi +++ b/stubs/Pillow/PIL/PngImagePlugin.pyi @@ -10,13 +10,13 @@ MAX_TEXT_CHUNK: Incomplete MAX_TEXT_MEMORY: Incomplete class Disposal(IntEnum): - OP_NONE: int - OP_BACKGROUND: int - OP_PREVIOUS: int + OP_NONE = 0 + OP_BACKGROUND = 1 + OP_PREVIOUS = 2 class Blend(IntEnum): - OP_SOURCE: int - OP_OVER: int + OP_SOURCE = 0 + OP_OVER = 1 class ChunkStream: fp: Incomplete diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/reservoir.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/reservoir.pyi index 322d1d38c3d8..e93d05f8b345 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/reservoir.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/reservoir.pyi @@ -10,6 +10,6 @@ class Reservoir: def TTL(self): ... class ReservoirDecision(Enum): - TAKE: str - BORROW: str - NO: str + TAKE = "take" + BORROW = "borrow" + NO = "no" diff --git a/stubs/fpdf2/fpdf/enums.pyi b/stubs/fpdf2/fpdf/enums.pyi index d1fa0fd7551b..dc2479558522 100644 --- a/stubs/fpdf2/fpdf/enums.pyi +++ b/stubs/fpdf2/fpdf/enums.pyi @@ -5,8 +5,8 @@ from typing_extensions import Self from .syntax import Name class SignatureFlag(IntEnum): - SIGNATURES_EXIST: int - APPEND_ONLY: int + SIGNATURES_EXIST = 1 + APPEND_ONLY = 2 class CoerciveEnum(Enum): @classmethod @@ -21,55 +21,55 @@ class CoerciveIntFlag(IntFlag): def coerce(cls, value: Self | str | int) -> Self: ... class WrapMode(CoerciveEnum): - WORD: str - CHAR: str + WORD = "WORD" + CHAR = "CHAR" class CharVPos(CoerciveEnum): - SUP: str - SUB: str - NOM: str - DENOM: str - LINE: str + SUP = "SUP" + SUB = "SUB" + NOM = "NOM" + DENOM = "DENOM" + LINE = "LINE" class Align(CoerciveEnum): - C: str - X: str - L: str - R: str - J: str + C = "CENTER" + X = "X_CENTER" + L = "LEFT" + R = "RIGHT" + J = "JUSTIFY" class VAlign(CoerciveEnum): - M: str - T: str - B: str + M = "MIDDLE" + T = "TOP" + B = "BOTTOM" class TextEmphasis(CoerciveIntFlag): - B: int - I: int - U: int + B = 1 + I = 2 + U = 4 @property def style(self) -> str: ... class MethodReturnValue(CoerciveIntFlag): - PAGE_BREAK: int - LINES: int - HEIGHT: int + PAGE_BREAK = 1 + LINES = 2 + HEIGHT = 4 class TableBordersLayout(CoerciveEnum): - ALL: str - NONE: str - INTERNAL: str - MINIMAL: str - HORIZONTAL_LINES: str - NO_HORIZONTAL_LINES: str - SINGLE_TOP_LINE: str + ALL = "ALL" + NONE = "NONE" + INTERNAL = "INTERNAL" + MINIMAL = "MINIMAL" + HORIZONTAL_LINES = "HORIZONTAL_LINES" + NO_HORIZONTAL_LINES = "NO_HORIZONTAL_LINES" + SINGLE_TOP_LINE = "SINGLE_TOP_LINE" class TableCellFillMode(CoerciveEnum): - NONE: str - ALL: str - ROWS: str - COLUMNS: str + NONE = "NONE" + ALL = "ALL" + ROWS = "ROWS" + COLUMNS = "COLUMNS" def should_fill_cell(self, i: int, j: int) -> bool: ... @@ -78,9 +78,9 @@ class TableSpan(CoerciveEnum): COL: Literal["COL"] class RenderStyle(CoerciveEnum): - D: str - F: str - DF: str + D = "DRAW" + F = "FILL" + DF = "DRAW_FILL" @property def operator(self) -> str: ... @property @@ -89,173 +89,173 @@ class RenderStyle(CoerciveEnum): def is_fill(self) -> bool: ... class TextMode(CoerciveIntEnum): - FILL: int - STROKE: int - FILL_STROKE: int - INVISIBLE: int - FILL_CLIP: int - STROKE_CLIP: int - FILL_STROKE_CLIP: int - CLIP: int + FILL = 0 + STROKE = 1 + FILL_STROKE = 2 + INVISIBLE = 3 + FILL_CLIP = 4 + STROKE_CLIP = 5 + FILL_STROKE_CLIP = 6 + CLIP = 7 class XPos(CoerciveEnum): - LEFT: str - RIGHT: str - START: str - END: str - WCONT: str - CENTER: str - LMARGIN: str - RMARGIN: str + LEFT = "LEFT" + RIGHT = "RIGHT" + START = "START" + END = "END" + WCONT = "WCONT" + CENTER = "CENTER" + LMARGIN = "LMARGIN" + RMARGIN = "RMARGIN" class YPos(CoerciveEnum): - TOP: str - LAST: str - NEXT: str - TMARGIN: str - BMARGIN: str + TOP = "TOP" + LAST = "LAST" + NEXT = "NEXT" + TMARGIN = "TMARGIN" + BMARGIN = "BMARGIN" class Angle(CoerciveIntEnum): - NORTH: int - EAST: int - SOUTH: int - WEST: int - NORTHEAST: int - SOUTHEAST: int - SOUTHWEST: int - NORTHWEST: int + NORTH = 90 + EAST = 0 + SOUTH = 270 + WEST = 180 + NORTHEAST = 45 + SOUTHEAST = 315 + SOUTHWEST = 225 + NORTHWEST = 135 class PageLayout(CoerciveEnum): - SINGLE_PAGE: Name - ONE_COLUMN: Name - TWO_COLUMN_LEFT: Name - TWO_COLUMN_RIGHT: Name - TWO_PAGE_LEFT: Name - TWO_PAGE_RIGHT: Name + SINGLE_PAGE = Name("SinglePage") + ONE_COLUMN = Name("OneColumn") + TWO_COLUMN_LEFT = Name("TwoColumnLeft") + TWO_COLUMN_RIGHT = Name("TwoColumnRight") + TWO_PAGE_LEFT = Name("TwoPageLeft") + TWO_PAGE_RIGHT = Name("TwoPageRight") class PageMode(CoerciveEnum): - USE_NONE: Name - USE_OUTLINES: Name - USE_THUMBS: Name - FULL_SCREEN: Name - USE_OC: Name - USE_ATTACHMENTS: Name + USE_NONE = Name("UseNone") + USE_OUTLINES = Name("UseOutlines") + USE_THUMBS = Name("UseThumbs") + FULL_SCREEN = Name("FullScreen") + USE_OC = Name("UseOC") + USE_ATTACHMENTS = Name("UseAttachments") class TextMarkupType(CoerciveEnum): - HIGHLIGHT: Name - UNDERLINE: Name - SQUIGGLY: Name - STRIKE_OUT: Name + HIGHLIGHT = Name("Highlight") + UNDERLINE = Name("Underline") + SQUIGGLY = Name("Squiggly") + STRIKE_OUT = Name("StrikeOut") class BlendMode(CoerciveEnum): - NORMAL: Name - MULTIPLY: Name - SCREEN: Name - OVERLAY: Name - DARKEN: Name - LIGHTEN: Name - COLOR_DODGE: Name - COLOR_BURN: Name - HARD_LIGHT: Name - SOFT_LIGHT: Name - DIFFERENCE: Name - EXCLUSION: Name - HUE: Name - SATURATION: Name - COLOR: Name - LUMINOSITY: Name + NORMAL = Name("Normal") + MULTIPLY = Name("Multiply") + SCREEN = Name("Screen") + OVERLAY = Name("Overlay") + DARKEN = Name("Darken") + LIGHTEN = Name("Lighten") + COLOR_DODGE = Name("ColorDodge") + COLOR_BURN = Name("ColorBurn") + HARD_LIGHT = Name("HardLight") + SOFT_LIGHT = Name("SoftLight") + DIFFERENCE = Name("Difference") + EXCLUSION = Name("Exclusion") + HUE = Name("Hue") + SATURATION = Name("Saturation") + COLOR = Name("Color") + LUMINOSITY = Name("Luminosity") class AnnotationFlag(CoerciveIntEnum): - INVISIBLE: int - HIDDEN: int - PRINT: int - NO_ZOOM: int - NO_ROTATE: int - NO_VIEW: int - READ_ONLY: int - LOCKED: int - TOGGLE_NO_VIEW: int - LOCKED_CONTENTS: int + INVISIBLE = 1 + HIDDEN = 2 + PRINT = 4 + NO_ZOOM = 8 + NO_ROTATE = 16 + NO_VIEW = 32 + READ_ONLY = 64 + LOCKED = 128 + TOGGLE_NO_VIEW = 256 + LOCKED_CONTENTS = 512 class AnnotationName(CoerciveEnum): - NOTE: Name - COMMENT: Name - HELP: Name - PARAGRAPH: Name - NEW_PARAGRAPH: Name - INSERT: Name + NOTE = Name("Note") + COMMENT = Name("Comment") + HELP = Name("Help") + PARAGRAPH = Name("Paragraph") + NEW_PARAGRAPH = Name("NewParagraph") + INSERT = Name("Insert") class FileAttachmentAnnotationName(CoerciveEnum): - PUSH_PIN: Name - GRAPH_PUSH_PIN: Name - PAPERCLIP_TAG: Name + PUSH_PIN = Name("PushPin") + GRAPH_PUSH_PIN = Name("GraphPushPin") + PAPERCLIP_TAG = Name("PaperclipTag") class IntersectionRule(CoerciveEnum): - NONZERO: str - EVENODD: str + NONZERO = "nonzero" + EVENODD = "evenodd" class PathPaintRule(CoerciveEnum): - STROKE: str - FILL_NONZERO: str - FILL_EVENODD: str - STROKE_FILL_NONZERO: str - STROKE_FILL_EVENODD: str - DONT_PAINT: str - AUTO: str + STROKE = "S" + FILL_NONZERO = "f" + FILL_EVENODD = "f*" + STROKE_FILL_NONZERO = "B" + STROKE_FILL_EVENODD = "B*" + DONT_PAINT = "n" + AUTO = "auto" class ClippingPathIntersectionRule(CoerciveEnum): - NONZERO: str - EVENODD: str + NONZERO = "W" + EVENODD = "W*" class StrokeCapStyle(CoerciveIntEnum): - BUTT: int - ROUND: int - SQUARE: int + BUTT = 0 + ROUND = 1 + SQUARE = 2 class StrokeJoinStyle(CoerciveIntEnum): - MITER: int - ROUND: int - BEVEL: int + MITER = 0 + ROUND = 1 + BEVEL = 2 class PDFStyleKeys(Enum): - FILL_ALPHA: Name - BLEND_MODE: Name - STROKE_ALPHA: Name - STROKE_ADJUSTMENT: Name - STROKE_WIDTH: Name - STROKE_CAP_STYLE: Name - STROKE_JOIN_STYLE: Name - STROKE_MITER_LIMIT: Name - STROKE_DASH_PATTERN: Name + FILL_ALPHA = Name("ca") + BLEND_MODE = Name("BM") + STROKE_ALPHA = Name("CA") + STROKE_ADJUSTMENT = Name("SA") + STROKE_WIDTH = Name("LW") + STROKE_CAP_STYLE = Name("LC") + STROKE_JOIN_STYLE = Name("LJ") + STROKE_MITER_LIMIT = Name("ML") + STROKE_DASH_PATTERN = Name("D") class Corner(CoerciveEnum): - TOP_RIGHT: str - TOP_LEFT: str - BOTTOM_RIGHT: str - BOTTOM_LEFT: str + TOP_RIGHT = "TOP_RIGHT" + TOP_LEFT = "TOP_LEFT" + BOTTOM_RIGHT = "BOTTOM_RIGHT" + BOTTOM_LEFT = "BOTTOM_LEFT" class FontDescriptorFlags(Flag): - FIXED_PITCH: int - SYMBOLIC: int - ITALIC: int - FORCE_BOLD: int + FIXED_PITCH = 1 + SYMBOLIC = 4 + ITALIC = 64 + FORCE_BOLD = 262144 class AccessPermission(IntFlag): - PRINT_LOW_RES: int - MODIFY: int - COPY: int - ANNOTATION: int - FILL_FORMS: int - COPY_FOR_ACCESSIBILITY: int - ASSEMBLE: int - PRINT_HIGH_RES: int + PRINT_LOW_RES = 4 + MODIFY = 8 + COPY = 16 + ANNOTATION = 32 + FILL_FORMS = 256 + COPY_FOR_ACCESSIBILITY = 512 + ASSEMBLE = 1024 + PRINT_HIGH_RES = 2048 @classmethod def all(cls) -> int: ... @classmethod def none(cls) -> Literal[0]: ... class EncryptionMethod(Enum): - NO_ENCRYPTION: int - RC4: int - AES_128: int - AES_256: int + NO_ENCRYPTION = 0 + RC4 = 1 + AES_128 = 2 + AES_256 = 3 diff --git a/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi b/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi index dada44e53043..8091fa70659b 100644 --- a/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi +++ b/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi @@ -19,13 +19,13 @@ class FluxQueryException(Exception): class FluxCsvParserException(Exception): ... class FluxSerializationMode(Enum): - tables: int - stream: int - dataFrame: int + tables = 1 + stream = 2 + dataFrame = 3 class FluxResponseMetadataMode(Enum): - full: int - only_names: int + full = 1 + only_names = 2 class _FluxCsvParserMetadata: table_index: int diff --git a/stubs/influxdb-client/influxdb_client/client/write_api.pyi b/stubs/influxdb-client/influxdb_client/client/write_api.pyi index 28d52b73247f..a753472c320a 100644 --- a/stubs/influxdb-client/influxdb_client/client/write_api.pyi +++ b/stubs/influxdb-client/influxdb_client/client/write_api.pyi @@ -17,9 +17,9 @@ _Observable: TypeAlias = Any # reactivex.Observable logger: logging.Logger class WriteType(Enum): - batching: int - asynchronous: int - synchronous: int + batching = 1 + asynchronous = 2 + synchronous = 3 class WriteOptions: write_type: WriteType diff --git a/stubs/pika/pika/delivery_mode.pyi b/stubs/pika/pika/delivery_mode.pyi index 8395e41294a1..61d5aa5c4237 100644 --- a/stubs/pika/pika/delivery_mode.pyi +++ b/stubs/pika/pika/delivery_mode.pyi @@ -1,5 +1,5 @@ from enum import Enum class DeliveryMode(Enum): - Transient: int - Persistent: int + Transient = 1 + Persistent = 2 diff --git a/stubs/pika/pika/exchange_type.pyi b/stubs/pika/pika/exchange_type.pyi index 73cbf3686454..ef55b20411f3 100644 --- a/stubs/pika/pika/exchange_type.pyi +++ b/stubs/pika/pika/exchange_type.pyi @@ -1,7 +1,7 @@ from enum import Enum class ExchangeType(Enum): - direct: str - fanout: str - headers: str - topic: str + direct = "direct" + fanout = "fanout" + headers = "headers" + topic = "topic" diff --git a/stubs/psutil/psutil/_common.pyi b/stubs/psutil/psutil/_common.pyi index 771525faba86..d755aa61d9a7 100644 --- a/stubs/psutil/psutil/_common.pyi +++ b/stubs/psutil/psutil/_common.pyi @@ -48,16 +48,16 @@ NIC_DUPLEX_HALF: int NIC_DUPLEX_UNKNOWN: int class NicDuplex(enum.IntEnum): - NIC_DUPLEX_FULL: int - NIC_DUPLEX_HALF: int - NIC_DUPLEX_UNKNOWN: int + NIC_DUPLEX_FULL = 2 + NIC_DUPLEX_HALF = 1 + NIC_DUPLEX_UNKNOWN = 0 POWER_TIME_UNKNOWN: int POWER_TIME_UNLIMITED: int class BatteryTime(enum.IntEnum): - POWER_TIME_UNKNOWN: int - POWER_TIME_UNLIMITED: int + POWER_TIME_UNKNOWN = -1 + POWER_TIME_UNLIMITED = -2 ENCODING: str ENCODING_ERRS: str diff --git a/stubs/psutil/psutil/_pslinux.pyi b/stubs/psutil/psutil/_pslinux.pyi index dacd14206953..3e390fda7075 100644 --- a/stubs/psutil/psutil/_pslinux.pyi +++ b/stubs/psutil/psutil/_pslinux.pyi @@ -36,10 +36,10 @@ IOPRIO_CLASS_BE: int IOPRIO_CLASS_IDLE: int class IOPriority(enum.IntEnum): - IOPRIO_CLASS_NONE: int - IOPRIO_CLASS_RT: int - IOPRIO_CLASS_BE: int - IOPRIO_CLASS_IDLE: int + IOPRIO_CLASS_NONE = 0 + IOPRIO_CLASS_RT = 1 + IOPRIO_CLASS_BE = 2 + IOPRIO_CLASS_IDLE = 3 PROC_STATUSES: Any TCP_STATUSES: Any diff --git a/stubs/psutil/psutil/_psutil_windows.pyi b/stubs/psutil/psutil/_psutil_windows.pyi index d0fc2b5e4022..a65eb03ed53f 100644 --- a/stubs/psutil/psutil/_psutil_windows.pyi +++ b/stubs/psutil/psutil/_psutil_windows.pyi @@ -1,11 +1,13 @@ -ABOVE_NORMAL_PRIORITY_CLASS: int -BELOW_NORMAL_PRIORITY_CLASS: int +from typing import Final + +ABOVE_NORMAL_PRIORITY_CLASS: Final = 32768 +BELOW_NORMAL_PRIORITY_CLASS: Final = 16384 ERROR_ACCESS_DENIED: int ERROR_INVALID_NAME: int ERROR_PRIVILEGE_NOT_HELD: int ERROR_SERVICE_DOES_NOT_EXIST: int -HIGH_PRIORITY_CLASS: int -IDLE_PRIORITY_CLASS: int +HIGH_PRIORITY_CLASS: Final = 128 +IDLE_PRIORITY_CLASS: Final = 64 INFINITE: int MIB_TCP_STATE_CLOSED: int MIB_TCP_STATE_CLOSE_WAIT: int @@ -19,9 +21,9 @@ MIB_TCP_STATE_LISTEN: int MIB_TCP_STATE_SYN_RCVD: int MIB_TCP_STATE_SYN_SENT: int MIB_TCP_STATE_TIME_WAIT: int -NORMAL_PRIORITY_CLASS: int +NORMAL_PRIORITY_CLASS: Final = 32 PSUTIL_CONN_NONE: int -REALTIME_PRIORITY_CLASS: int +REALTIME_PRIORITY_CLASS: Final = 256 WINDOWS_10: int WINDOWS_7: int WINDOWS_8: int diff --git a/stubs/psutil/psutil/_pswindows.pyi b/stubs/psutil/psutil/_pswindows.pyi index da4b7f78f845..283286b1a6af 100644 --- a/stubs/psutil/psutil/_pswindows.pyi +++ b/stubs/psutil/psutil/_pswindows.pyi @@ -36,12 +36,12 @@ AddressFamily: Any TCP_STATUSES: Any class Priority(enum.IntEnum): - ABOVE_NORMAL_PRIORITY_CLASS: Any - BELOW_NORMAL_PRIORITY_CLASS: Any - HIGH_PRIORITY_CLASS: Any - IDLE_PRIORITY_CLASS: Any - NORMAL_PRIORITY_CLASS: Any - REALTIME_PRIORITY_CLASS: Any + ABOVE_NORMAL_PRIORITY_CLASS = ABOVE_NORMAL_PRIORITY_CLASS + BELOW_NORMAL_PRIORITY_CLASS = BELOW_NORMAL_PRIORITY_CLASS + HIGH_PRIORITY_CLASS = HIGH_PRIORITY_CLASS + IDLE_PRIORITY_CLASS = IDLE_PRIORITY_CLASS + NORMAL_PRIORITY_CLASS = NORMAL_PRIORITY_CLASS + REALTIME_PRIORITY_CLASS = REALTIME_PRIORITY_CLASS IOPRIO_VERYLOW: int IOPRIO_LOW: int @@ -49,10 +49,10 @@ IOPRIO_NORMAL: int IOPRIO_HIGH: int class IOPriority(enum.IntEnum): - IOPRIO_VERYLOW: int - IOPRIO_LOW: int - IOPRIO_NORMAL: int - IOPRIO_HIGH: int + IOPRIO_VERYLOW = 0 + IOPRIO_LOW = 1 + IOPRIO_NORMAL = 2 + IOPRIO_HIGH = 3 pinfo_map: Any diff --git a/stubs/pynput/pynput/keyboard/_base.pyi b/stubs/pynput/pynput/keyboard/_base.pyi index 692af81ef482..5050c52ee832 100644 --- a/stubs/pynput/pynput/keyboard/_base.pyi +++ b/stubs/pynput/pynput/keyboard/_base.pyi @@ -25,71 +25,71 @@ class KeyCode: def from_dead(cls, char: str, **kwargs: Any) -> Self: ... class Key(enum.Enum): - alt: int - alt_l: int - alt_r: int - alt_gr: int - backspace: int - caps_lock: int - cmd: int - cmd_l: int - cmd_r: int - ctrl: int - ctrl_l: int - ctrl_r: int - delete: int - down: int - end: int - enter: int - esc: int - f1: int - f2: int - f3: int - f4: int - f5: int - f6: int - f7: int - f8: int - f9: int - f10: int - f11: int - f12: int - f13: int - f14: int - f15: int - f16: int - f17: int - f18: int - f19: int - f20: int + alt = 0 + alt_l = alt + alt_r = alt + alt_gr = alt + backspace = alt + caps_lock = alt + cmd = alt + cmd_l = alt + cmd_r = alt + ctrl = alt + ctrl_l = alt + ctrl_r = alt + delete = alt + down = alt + end = alt + enter = alt + esc = alt + f1 = alt + f2 = alt + f3 = alt + f4 = alt + f5 = alt + f6 = alt + f7 = alt + f8 = alt + f9 = alt + f10 = alt + f11 = alt + f12 = alt + f13 = alt + f14 = alt + f15 = alt + f16 = alt + f17 = alt + f18 = alt + f19 = alt + f20 = alt if sys.platform == "win32": - f21: int - f22: int - f23: int - f24: int - home: int - left: int - page_down: int - page_up: int - right: int - shift: int - shift_l: int - shift_r: int - space: int - tab: int - up: int - media_play_pause: int - media_volume_mute: int - media_volume_down: int - media_volume_up: int - media_previous: int - media_next: int - insert: int - menu: int - num_lock: int - pause: int - print_screen: int - scroll_lock: int + f21 = alt + f22 = alt + f23 = alt + f24 = alt + home = alt + left = alt + page_down = alt + page_up = alt + right = alt + shift = alt + shift_l = alt + shift_r = alt + space = alt + tab = alt + up = alt + media_play_pause = alt + media_volume_mute = alt + media_volume_down = alt + media_volume_up = alt + media_previous = alt + media_next = alt + insert = alt + menu = alt + num_lock = alt + pause = alt + print_screen = alt + scroll_lock = alt class Controller: _KeyCode: ClassVar[type[KeyCode]] # undocumented diff --git a/stubs/pynput/pynput/mouse/_base.pyi b/stubs/pynput/pynput/mouse/_base.pyi index 10141121b1d7..4874e3be814f 100644 --- a/stubs/pynput/pynput/mouse/_base.pyi +++ b/stubs/pynput/pynput/mouse/_base.pyi @@ -8,41 +8,41 @@ from typing_extensions import Self from pynput._util import AbstractListener class Button(enum.Enum): - unknown: int - left: int - middle: int - right: int + unknown = 0 + left = 1 + middle = 2 + right = 3 if sys.platform == "linux": - button8: int - button9: int - button10: int - button11: int - button12: int - button13: int - button14: int - button15: int - button16: int - button17: int - button18: int - button19: int - button20: int - button21: int - button22: int - button23: int - button24: int - button25: int - button26: int - button27: int - button28: int - button29: int - button30: int - scroll_down: int - scroll_left: int - scroll_right: int - scroll_up: int + button8 = 8 + button9 = 9 + button10 = 10 + button11 = 11 + button12 = 12 + button13 = 13 + button14 = 14 + button15 = 15 + button16 = 16 + button17 = 17 + button18 = 18 + button19 = 19 + button20 = 20 + button21 = 21 + button22 = 22 + button23 = 23 + button24 = 24 + button25 = 25 + button26 = 26 + button27 = 27 + button28 = 28 + button29 = 29 + button30 = 30 + scroll_down = 5 + scroll_left = 6 + scroll_right = 7 + scroll_up = 4 if sys.platform == "win32": - x1: int - x2: int + x1 = 0 # Value unknown + x2 = 0 # Value unknown class Controller: def __init__(self) -> None: ... diff --git a/stubs/redis/redis/asyncio/connection.pyi b/stubs/redis/redis/asyncio/connection.pyi index a20696a4ba76..e337975c0130 100644 --- a/stubs/redis/redis/asyncio/connection.pyi +++ b/stubs/redis/redis/asyncio/connection.pyi @@ -24,7 +24,7 @@ SYM_EMPTY: Final[bytes] SERVER_CLOSED_CONNECTION_ERROR: Final[str] class _Sentinel(enum.Enum): - sentinel: object + sentinel = object() SENTINEL: Final[object] MODULE_LOAD_ERROR: Final[str] diff --git a/stubs/regex/regex/_regex_core.pyi b/stubs/regex/regex/_regex_core.pyi index e5ab3f970920..6c002ddf420a 100644 --- a/stubs/regex/regex/_regex_core.pyi +++ b/stubs/regex/regex/_regex_core.pyi @@ -9,40 +9,40 @@ class error(Exception): def __init__(self, message: str, pattern: AnyStr | None = None, pos: int | None = None) -> None: ... class RegexFlag(enum.IntFlag): - A: int - ASCII: int - B: int - BESTMATCH: int - D: int - DEBUG: int - E: int - ENHANCEMATCH: int - F: int - FULLCASE: int - I: int - IGNORECASE: int - L: int - LOCALE: int - M: int - MULTILINE: int - P: int - POSIX: int - R: int - REVERSE: int - T: int - TEMPLATE: int - S: int - DOTALL: int - U: int - UNICODE: int - V0: int - VERSION0: int - V1: int - VERSION1: int - W: int - WORD: int - X: int - VERBOSE: int + A = 0x80 + ASCII = A + B = 0x1000 + BESTMATCH = B + D = 0x200 + DEBUG = D + E = 0x8000 + ENHANCEMATCH = E + F = 0x4000 + FULLCASE = F + I = 0x2 + IGNORECASE = I + L = 0x4 + LOCALE = L + M = 0x8 + MULTILINE = M + P = 0x10000 + POSIX = P + R = 0x400 + REVERSE = R + T = 0x1 + TEMPLATE = T + S = 0x10 + DOTALL = S + U = 0x20 + UNICODE = U + V0 = 0x2000 + VERSION0 = V0 + V1 = 0x100 + VERSION1 = V1 + W = 0x800 + WORD = W + X = 0x40 + VERBOSE = X A: int ASCII: int diff --git a/stubs/setuptools/setuptools/command/editable_wheel.pyi b/stubs/setuptools/setuptools/command/editable_wheel.pyi index 729739d823ce..c460643394f9 100644 --- a/stubs/setuptools/setuptools/command/editable_wheel.pyi +++ b/stubs/setuptools/setuptools/command/editable_wheel.pyi @@ -13,9 +13,9 @@ from ..warnings import SetuptoolsWarning _WheelFile: TypeAlias = Incomplete class _EditableMode(Enum): - STRICT: str - LENIENT: str - COMPAT: str + STRICT = "strict" + LENIENT = "lenient" + COMPAT = "compat" @classmethod def convert(cls, mode: str | None) -> _EditableMode: ...