From 63aa5c085607a6328798093cde7be6e31a16847f Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 10:13:56 -0700 Subject: [PATCH 1/7] Add __slots__ to third-party packages using stubdefaulter --- pyproject.toml | 1 + stubs/PyMySQL/pymysql/protocol.pyi | 1 + stubs/PyYAML/yaml/__init__.pyi | 1 + stubs/WebOb/webob/cookies.pyi | 1 + stubs/aiofiles/aiofiles/base.pyi | 1 + .../antlr4/BufferedTokenStream.pyi | 1 + .../antlr4/CommonTokenFactory.pyi | 1 + .../antlr4/CommonTokenStream.pyi | 1 + .../antlr4/FileStream.pyi | 1 + .../antlr4/InputStream.pyi | 1 + .../antlr4/IntervalSet.pyi | 1 + .../antlr4/LL1Analyzer.pyi | 1 + stubs/antlr4-python3-runtime/antlr4/Lexer.pyi | 16 ++++ .../antlr4/ListTokenSource.pyi | 1 + .../antlr4-python3-runtime/antlr4/Parser.pyi | 12 +++ .../antlr4/ParserInterpreter.pyi | 10 ++ .../antlr4/ParserRuleContext.pyi | 1 + .../antlr4/Recognizer.pyi | 1 + .../antlr4/RuleContext.pyi | 1 + stubs/antlr4-python3-runtime/antlr4/Token.pyi | 1 + .../antlr4/TokenStreamRewriter.pyi | 3 + .../antlr4-python3-runtime/antlr4/atn/ATN.pyi | 12 +++ .../antlr4/atn/ATNConfig.pyi | 2 + .../antlr4/atn/ATNConfigSet.pyi | 11 +++ .../antlr4/atn/ATNDeserializationOptions.pyi | 1 + .../antlr4/atn/ATNDeserializer.pyi | 1 + .../antlr4/atn/ATNSimulator.pyi | 1 + .../antlr4/atn/ATNState.pyi | 8 ++ .../antlr4/atn/LexerATNSimulator.pyi | 2 + .../antlr4/atn/LexerAction.pyi | 7 ++ .../antlr4/atn/LexerActionExecutor.pyi | 1 + .../antlr4/atn/ParserATNSimulator.pyi | 1 + .../antlr4/atn/SemanticContext.pyi | 3 + .../antlr4/atn/Transition.pyi | 10 ++ .../antlr4-python3-runtime/antlr4/dfa/DFA.pyi | 1 + .../antlr4/dfa/DFASerializer.pyi | 1 + .../antlr4/dfa/DFAState.pyi | 11 +++ .../antlr4/tree/Chunk.pyi | 2 + .../antlr4/tree/ParseTreeMatch.pyi | 1 + .../antlr4/tree/ParseTreePattern.pyi | 1 + .../antlr4/tree/ParseTreePatternMatcher.pyi | 1 + .../antlr4/tree/RuleTagToken.pyi | 1 + .../antlr4/tree/TokenTagToken.pyi | 1 + .../antlr4/tree/Tree.pyi | 1 + stubs/boltons/boltons/dictutils.pyi | 2 + stubs/boltons/boltons/mathutils.pyi | 1 + stubs/boltons/boltons/setutils.pyi | 1 + stubs/boltons/boltons/tbutils.pyi | 1 + stubs/cffi/cffi/backend_ctypes.pyi | 7 +- stubs/defusedxml/defusedxml/lxml.pyi | 1 + .../docutils/utils/_roman_numerals.pyi | 1 + stubs/fpdf2/fpdf/annotations.pyi | 20 ++++ stubs/fpdf2/fpdf/bidi.pyi | 4 + stubs/fpdf2/fpdf/fonts.pyi | 24 +++++ stubs/fpdf2/fpdf/outline.pyi | 3 + stubs/fpdf2/fpdf/output.pyi | 36 +++++++ stubs/fpdf2/fpdf/structure_tree.pyi | 3 + stubs/fpdf2/fpdf/table.pyi | 1 + stubs/gevent/gevent/_abstract_linkable.pyi | 1 + stubs/gevent/gevent/_fileobjectcommon.pyi | 3 +- stubs/gevent/gevent/_ident.pyi | 1 + stubs/gevent/gevent/_monitor.pyi | 1 + stubs/gevent/gevent/_threading.pyi | 1 + stubs/gevent/gevent/_waiter.pyi | 4 +- stubs/gevent/gevent/event.pyi | 2 + stubs/gevent/gevent/hub.pyi | 1 + stubs/gevent/gevent/local.pyi | 9 ++ stubs/gevent/gevent/lock.pyi | 5 +- stubs/gevent/gevent/pool.pyi | 1 + stubs/gevent/gevent/pywsgi.pyi | 15 ++- stubs/gevent/gevent/queue.pyi | 11 ++- stubs/gevent/gevent/threadpool.pyi | 12 +++ .../grpc_channelz/v1/channelz_pb2.pyi | 39 ++++++++ .../grpc_health/v1/health_pb2.pyi | 2 + .../v1alpha/reflection_pb2.pyi | 8 ++ stubs/jsonschema/jsonschema/_types.pyi | 1 + stubs/jsonschema/jsonschema/cli.pyi | 3 + stubs/jsonschema/jsonschema/validators.pyi | 23 +++-- stubs/netaddr/netaddr/eui/__init__.pyi | 4 + stubs/netaddr/netaddr/ip/__init__.pyi | 5 + stubs/netaddr/netaddr/ip/glob.pyi | 1 + stubs/netaddr/netaddr/ip/sets.pyi | 1 + .../networkx/algorithms/flow/utils.pyi | 2 + .../networkx/algorithms/planarity.pyi | 20 ++++ stubs/networkx/networkx/classes/coreviews.pyi | 17 +++- .../networkx/networkx/classes/reportviews.pyi | 24 ++++- stubs/networkx/networkx/utils/configs.pyi | 1 + stubs/networkx/networkx/utils/heaps.pyi | 2 + .../networkx/networkx/utils/mapped_queue.pyi | 1 + .../oauthlib/oauth2/rfc6749/tokens.pyi | 2 + .../oauthlib/openid/connect/core/tokens.pyi | 1 + stubs/openpyxl/openpyxl/cell/cell.pyi | 2 + stubs/openpyxl/openpyxl/cell/read_only.pyi | 2 + stubs/openpyxl/openpyxl/formula/tokenizer.pyi | 1 + stubs/openpyxl/openpyxl/styles/cell_style.pyi | 1 + stubs/openpyxl/openpyxl/styles/proxy.pyi | 1 + stubs/openpyxl/openpyxl/styles/styleable.pyi | 1 + stubs/paramiko/paramiko/transport.pyi | 1 + .../parsimonious/parsimonious/expressions.pyi | 6 ++ stubs/parsimonious/parsimonious/nodes.pyi | 2 + stubs/parsimonious/parsimonious/utils.pyi | 1 + .../pika/adapters/blocking_connection.pyi | 9 ++ .../pika/pika/adapters/gevent_connection.pyi | 1 + .../pika/pika/adapters/select_connection.pyi | 1 + .../utils/selector_ioloop_adapter.pyi | 1 + stubs/pika/pika/connection.pyi | 21 ++++ stubs/pony/pony/orm/core.pyi | 96 ++++++++++++++++++- stubs/pony/pony/orm/dbproviders/mysql.pyi | 3 +- stubs/pony/pony/orm/dbproviders/sqlite.pyi | 3 +- .../pony/pony/orm/examples/alessandro_bug.pyi | 3 + .../pony/pony/orm/examples/compositekeys.pyi | 11 +++ stubs/pony/pony/orm/examples/demo.pyi | 4 + stubs/pony/pony/orm/examples/estore.pyi | 6 ++ stubs/pony/pony/orm/examples/inheritance1.pyi | 9 +- stubs/pony/pony/orm/examples/numbers.pyi | 1 + stubs/pony/pony/orm/examples/university1.pyi | 4 + stubs/pony/pony/orm/examples/university2.pyi | 12 +++ stubs/pony/pony/orm/ormtypes.pyi | 3 + stubs/pony/pony/orm/sqlbuilding.pyi | 3 + stubs/protobuf/google/protobuf/any_pb2.pyi | 2 + stubs/protobuf/google/protobuf/api_pb2.pyi | 6 ++ .../google/protobuf/compiler/plugin_pb2.pyi | 8 ++ .../google/protobuf/descriptor_pb2.pyi | 53 ++++++++++ .../protobuf/google/protobuf/duration_pb2.pyi | 2 + stubs/protobuf/google/protobuf/empty_pb2.pyi | 2 + .../google/protobuf/field_mask_pb2.pyi | 2 + .../google/protobuf/internal/containers.pyi | 5 + .../protobuf/internal/well_known_types.pyi | 6 ++ stubs/protobuf/google/protobuf/message.pyi | 1 + .../google/protobuf/source_context_pb2.pyi | 2 + stubs/protobuf/google/protobuf/struct_pb2.pyi | 7 ++ .../google/protobuf/timestamp_pb2.pyi | 2 + stubs/protobuf/google/protobuf/type_pb2.pyi | 10 ++ .../protobuf/google/protobuf/wrappers_pb2.pyi | 18 ++++ stubs/psutil/psutil/_psosx.pyi | 1 + .../lib/modulegraph/modulegraph.pyi | 11 +++ stubs/python-dateutil/dateutil/_common.pyi | 1 + .../dateutil/parser/_parser.pyi | 2 + stubs/python-dateutil/dateutil/rrule.pyi | 17 ++++ stubs/python-dateutil/dateutil/tz/tz.pyi | 1 + stubs/shapely/shapely/geometry/base.pyi | 2 + stubs/shapely/shapely/geometry/collection.pyi | 1 + stubs/shapely/shapely/geometry/linestring.pyi | 1 + .../shapely/geometry/multilinestring.pyi | 1 + stubs/shapely/shapely/geometry/multipoint.pyi | 1 + .../shapely/shapely/geometry/multipolygon.pyi | 1 + stubs/shapely/shapely/geometry/point.pyi | 1 + stubs/shapely/shapely/geometry/polygon.pyi | 2 + .../translationstring/__init__.pyi | 1 + stubs/xlrd/xlrd/sheet.pyi | 13 +++ 150 files changed, 835 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1ef50ab4a8de..c523ec07b934 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -177,6 +177,7 @@ ignore = [ "TRY003", # Avoid specifying long messages outside the exception class # Slower and more verbose https://github.com/astral-sh/ruff/issues/7871 "UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` + "PLC0205", # Sometimes __slots__ really is a string at runtime ### # False-positives, but already checked by type-checkers ### diff --git a/stubs/PyMySQL/pymysql/protocol.pyi b/stubs/PyMySQL/pymysql/protocol.pyi index 94ba5a8674f1..dd742364215a 100644 --- a/stubs/PyMySQL/pymysql/protocol.pyi +++ b/stubs/PyMySQL/pymysql/protocol.pyi @@ -11,6 +11,7 @@ UNSIGNED_INT64_COLUMN: Final[int] def dump_packet(data) -> None: ... class MysqlPacket: + __slots__ = ("_position", "_data") def __init__(self, data, encoding) -> None: ... def get_all_data(self): ... def read(self, size): ... diff --git a/stubs/PyYAML/yaml/__init__.pyi b/stubs/PyYAML/yaml/__init__.pyi index 883492c73b4b..715d37e4d30e 100644 --- a/stubs/PyYAML/yaml/__init__.pyi +++ b/stubs/PyYAML/yaml/__init__.pyi @@ -428,6 +428,7 @@ class YAMLObjectMetaclass(type): def __init__(cls, name, bases, kwds) -> None: ... class YAMLObject(metaclass=YAMLObjectMetaclass): + __slots__ = () yaml_loader: Any yaml_dumper: Any yaml_tag: Any diff --git a/stubs/WebOb/webob/cookies.pyi b/stubs/WebOb/webob/cookies.pyi index ac39a569f270..5846b68d9e14 100644 --- a/stubs/WebOb/webob/cookies.pyi +++ b/stubs/WebOb/webob/cookies.pyi @@ -60,6 +60,7 @@ class Cookie(dict[bytes, Morsel]): def __str__(self, full: bool = True) -> str: ... class Morsel(dict[bytes, bytes | bool | None]): + __slots__ = ("name", "value") name: bytes value: bytes def __init__(self, name: str | bytes, value: str | bytes) -> None: ... diff --git a/stubs/aiofiles/aiofiles/base.pyi b/stubs/aiofiles/aiofiles/base.pyi index 4b10dfb80613..4a22ddd6f160 100644 --- a/stubs/aiofiles/aiofiles/base.pyi +++ b/stubs/aiofiles/aiofiles/base.pyi @@ -20,6 +20,7 @@ class AsyncIndirectBase(AsyncBase[_T]): ) -> None: ... class AiofilesContextManager(Awaitable[_V_co], AbstractAsyncContextManager[_V_co]): + __slots__ = ("_coro", "_obj") def __init__(self, coro: Awaitable[_V_co]) -> None: ... def __await__(self) -> Generator[Any, Any, _V_co]: ... async def __aenter__(self) -> _V_co: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi b/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi index bf21e75e68a6..aeca2e341ed8 100644 --- a/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi @@ -8,6 +8,7 @@ Lexer: Incomplete class TokenStream: ... class BufferedTokenStream(TokenStream): + __slots__ = ("tokenSource", "tokens", "index", "fetchedEOF") tokenSource: Incomplete tokens: Incomplete index: int diff --git a/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi b/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi index 5887446c9d92..447f2a6f6274 100644 --- a/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi @@ -5,6 +5,7 @@ from antlr4.Token import CommonToken as CommonToken class TokenFactory: ... class CommonTokenFactory(TokenFactory): + __slots__ = "copyText" DEFAULT: Incomplete copyText: Incomplete def __init__(self, copyText: bool = False) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi b/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi index 34abe2d04e8c..304106cd8ba3 100644 --- a/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi @@ -5,6 +5,7 @@ from antlr4.Lexer import Lexer as Lexer from antlr4.Token import Token as Token class CommonTokenStream(BufferedTokenStream): + __slots__ = "channel" channel: Incomplete def __init__(self, lexer: Lexer, channel: int = 0) -> None: ... def adjustSeekIndex(self, i: int) -> int: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi b/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi index c55094a91456..dc759a462f15 100644 --- a/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi @@ -3,6 +3,7 @@ from _typeshed import Incomplete from antlr4.InputStream import InputStream as InputStream class FileStream(InputStream): + __slots__ = "fileName" fileName: Incomplete def __init__(self, fileName: str, encoding: str = "ascii", errors: str = "strict") -> None: ... def readDataFrom(self, fileName: str, encoding: str, errors: str = "strict"): ... diff --git a/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi b/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi index d42ed870429c..3a5991e5ba94 100644 --- a/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi @@ -3,6 +3,7 @@ from _typeshed import Incomplete from antlr4.Token import Token as Token class InputStream: + __slots__ = ("name", "strdata", "_index", "data", "_size") name: str strdata: Incomplete data: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/IntervalSet.pyi b/stubs/antlr4-python3-runtime/antlr4/IntervalSet.pyi index 6a6d56fdf83b..2b84ca4e317e 100644 --- a/stubs/antlr4-python3-runtime/antlr4/IntervalSet.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/IntervalSet.pyi @@ -1,6 +1,7 @@ from antlr4.Token import Token as Token class IntervalSet: + __slots__ = ("intervals", "readonly") intervals: list[range] | None readonly: bool def __init__(self) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/LL1Analyzer.pyi b/stubs/antlr4-python3-runtime/antlr4/LL1Analyzer.pyi index 1963fd468b85..5742e60131ca 100644 --- a/stubs/antlr4-python3-runtime/antlr4/LL1Analyzer.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/LL1Analyzer.pyi @@ -19,6 +19,7 @@ from antlr4.RuleContext import RuleContext as RuleContext from antlr4.Token import Token as Token class LL1Analyzer: + __slots__ = "atn" HIT_PRED: Incomplete atn: Incomplete def __init__(self, atn: ATN) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi b/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi index 41a63716ffff..1ac2177ffbad 100644 --- a/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi @@ -15,6 +15,22 @@ from antlr4.Token import Token as Token class TokenSource: ... class Lexer(Recognizer, TokenSource): + __slots__ = ( + "_input", + "_output", + "_factory", + "_tokenFactorySourcePair", + "_token", + "_tokenStartCharIndex", + "_tokenStartLine", + "_tokenStartColumn", + "_hitEOF", + "_channel", + "_type", + "_modeStack", + "_mode", + "_text", + ) DEFAULT_MODE: int MORE: int SKIP: int diff --git a/stubs/antlr4-python3-runtime/antlr4/ListTokenSource.pyi b/stubs/antlr4-python3-runtime/antlr4/ListTokenSource.pyi index 935f1b738024..e327864814cc 100644 --- a/stubs/antlr4-python3-runtime/antlr4/ListTokenSource.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/ListTokenSource.pyi @@ -5,6 +5,7 @@ from antlr4.Lexer import TokenSource as TokenSource from antlr4.Token import Token as Token class ListTokenSource(TokenSource): + __slots__ = ("tokens", "sourceName", "pos", "eofToken", "_factory") tokens: Incomplete sourceName: Incomplete pos: int diff --git a/stubs/antlr4-python3-runtime/antlr4/Parser.pyi b/stubs/antlr4-python3-runtime/antlr4/Parser.pyi index 2a89284c5a68..42cf6443cc97 100644 --- a/stubs/antlr4-python3-runtime/antlr4/Parser.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/Parser.pyi @@ -20,6 +20,7 @@ from antlr4.tree.ParseTreePatternMatcher import ParseTreePatternMatcher as Parse from antlr4.tree.Tree import ErrorNode as ErrorNode, ParseTreeListener as ParseTreeListener, TerminalNode as TerminalNode class TraceListener(ParseTreeListener): + __slots__ = "_parser" def __init__(self, parser) -> None: ... def enterEveryRule(self, ctx) -> None: ... def visitTerminal(self, node) -> None: ... @@ -27,6 +28,17 @@ class TraceListener(ParseTreeListener): def exitEveryRule(self, ctx) -> None: ... class Parser(Recognizer): + __slots__ = ( + "_input", + "_output", + "_errHandler", + "_precedenceStack", + "_ctx", + "buildParseTrees", + "_tracer", + "_parseListeners", + "_syntaxErrors", + ) bypassAltsAtnCache: Incomplete buildParseTrees: bool def __init__(self, input: TokenStream, output: TextIO = ...) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi b/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi index 4405ed5dfa6e..b7dabbc4aa33 100644 --- a/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi @@ -18,6 +18,16 @@ from antlr4.PredictionContext import PredictionContextCache as PredictionContext from antlr4.Token import Token as Token class ParserInterpreter(Parser): + __slots__ = ( + "grammarFileName", + "atn", + "tokenNames", + "ruleNames", + "decisionToDFA", + "sharedContextCache", + "_parentContextStack", + "pushRecursionContextStates", + ) grammarFileName: Incomplete atn: Incomplete tokenNames: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi b/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi index b687a84d2713..73c5c5d752b4 100644 --- a/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi @@ -13,6 +13,7 @@ from antlr4.tree.Tree import ( ) class ParserRuleContext(RuleContext): + __slots__ = ("children", "start", "stop", "exception") children: Incomplete start: Incomplete stop: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi b/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi index b671ec91105f..5e9fcc8bc086 100644 --- a/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi @@ -5,6 +5,7 @@ from antlr4.RuleContext import RuleContext as RuleContext from antlr4.Token import Token as Token class Recognizer: + __slots__ = ("_listeners", "_interp", "_stateNumber") tokenTypeMapCache: Incomplete ruleIndexMapCache: Incomplete def __init__(self) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi b/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi index 178d903f0dfe..c7bb19b4e31e 100644 --- a/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi @@ -7,6 +7,7 @@ from antlr4.tree.Trees import Trees as Trees Parser: Incomplete class RuleContext(RuleNode): + __slots__ = ("parentCtx", "invokingState") EMPTY: Incomplete parentCtx: Incomplete invokingState: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/Token.pyi b/stubs/antlr4-python3-runtime/antlr4/Token.pyi index 8f93ed2564b1..3ca3b3c58eee 100644 --- a/stubs/antlr4-python3-runtime/antlr4/Token.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/Token.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete class Token: + __slots__ = ("source", "type", "channel", "start", "stop", "tokenIndex", "line", "column", "_text") INVALID_TYPE: int EPSILON: int MIN_USER_TOKEN_TYPE: int diff --git a/stubs/antlr4-python3-runtime/antlr4/TokenStreamRewriter.pyi b/stubs/antlr4-python3-runtime/antlr4/TokenStreamRewriter.pyi index 92aa2a6ccc69..81e2601e7be6 100644 --- a/stubs/antlr4-python3-runtime/antlr4/TokenStreamRewriter.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/TokenStreamRewriter.pyi @@ -4,6 +4,7 @@ from antlr4.CommonTokenStream import CommonTokenStream as CommonTokenStream from antlr4.Token import Token as Token class TokenStreamRewriter: + __slots__ = ("tokens", "programs", "lastRewriteTokenIndexes") DEFAULT_PROGRAM_NAME: str PROGRAM_INIT_SIZE: int MIN_TOKEN_INDEX: int @@ -34,6 +35,7 @@ class TokenStreamRewriter: def getText(self, program_name, start: int, stop: int): ... class RewriteOperation: + __slots__ = ("tokens", "index", "text", "instructionIndex") tokens: Incomplete index: Incomplete text: Incomplete @@ -48,6 +50,7 @@ class TokenStreamRewriter: class InsertAfterOp(InsertBeforeOp): ... class ReplaceOp(RewriteOperation): + __slots__ = "last_index" last_index: Incomplete def __init__(self, from_idx, to_idx, tokens, text) -> None: ... def execute(self, buf): ... diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ATN.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ATN.pyi index cdef3f41715d..f0951194380c 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ATN.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ATN.pyi @@ -7,6 +7,18 @@ from antlr4.RuleContext import RuleContext as RuleContext from antlr4.Token import Token as Token class ATN: + __slots__ = ( + "grammarType", + "maxTokenType", + "states", + "decisionToState", + "ruleToStartState", + "ruleToStopState", + "modeNameToStartState", + "ruleToTokenType", + "lexerActions", + "modeToStartState", + ) INVALID_ALT_NUMBER: int grammarType: Incomplete maxTokenType: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfig.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfig.pyi index 99018332d164..12046c969e40 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfig.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfig.pyi @@ -6,6 +6,7 @@ from antlr4.atn.SemanticContext import SemanticContext as SemanticContext from antlr4.PredictionContext import PredictionContext as PredictionContext class ATNConfig: + __slots__ = ("state", "alt", "context", "semanticContext", "reachesIntoOuterContext", "precedenceFilterSuppressed") state: Incomplete alt: Incomplete context: Incomplete @@ -26,6 +27,7 @@ class ATNConfig: def equalsForConfigSet(self, other): ... class LexerATNConfig(ATNConfig): + __slots__ = ("lexerActionExecutor", "passedThroughNonGreedyDecision") lexerActionExecutor: Incomplete passedThroughNonGreedyDecision: Incomplete def __init__( diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfigSet.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfigSet.pyi index 0c7ac52b273d..aa82c295ce57 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfigSet.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ATNConfigSet.pyi @@ -13,6 +13,17 @@ from antlr4.Utils import str_list as str_list ATNSimulator: Incomplete class ATNConfigSet: + __slots__ = ( + "configLookup", + "fullCtx", + "readonly", + "configs", + "uniqueAlt", + "conflictingAlts", + "hasSemanticContext", + "dipsIntoOuterContext", + "cachedHashCode", + ) configLookup: Incomplete fullCtx: Incomplete readonly: bool diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializationOptions.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializationOptions.pyi index e1834444b474..9a2021cd7d67 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializationOptions.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializationOptions.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete class ATNDeserializationOptions: + __slots__ = ("readonly", "verifyATN", "generateRuleBypassTransitions") defaultOptions: Incomplete readonly: bool verifyATN: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializer.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializer.pyi index 8c2a67e5a627..ed6b48bf8f84 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializer.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ATNDeserializer.pyi @@ -11,6 +11,7 @@ from antlr4.Token import Token as Token SERIALIZED_VERSION: int class ATNDeserializer: + __slots__ = ("deserializationOptions", "data", "pos") deserializationOptions: Incomplete def __init__(self, options: ATNDeserializationOptions | None = None) -> None: ... data: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ATNSimulator.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ATNSimulator.pyi index 11fbfe7b0705..2ca0b846e9c9 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ATNSimulator.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ATNSimulator.pyi @@ -10,6 +10,7 @@ from antlr4.PredictionContext import ( ) class ATNSimulator: + __slots__ = ("atn", "sharedContextCache", "__dict__") ERROR: Incomplete atn: Incomplete sharedContextCache: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ATNState.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ATNState.pyi index 79b7e4818b3a..5b432fa26026 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ATNState.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ATNState.pyi @@ -5,6 +5,7 @@ from antlr4.atn.Transition import Transition as Transition INITIAL_NUM_TRANSITIONS: int class ATNState: + __slots__ = ("atn", "stateNumber", "stateType", "ruleIndex", "epsilonOnlyTransitions", "transitions", "nextTokenWithinRule") INVALID_TYPE: int BASIC: int RULE_START: int @@ -39,11 +40,13 @@ class BasicState(ATNState): def __init__(self) -> None: ... class DecisionState(ATNState): + __slots__ = ("decision", "nonGreedy") decision: int nonGreedy: bool def __init__(self) -> None: ... class BlockStartState(DecisionState): + __slots__ = "endState" endState: Incomplete def __init__(self) -> None: ... @@ -52,6 +55,7 @@ class BasicBlockStartState(BlockStartState): def __init__(self) -> None: ... class BlockEndState(ATNState): + __slots__ = "startState" stateType: Incomplete startState: Incomplete def __init__(self) -> None: ... @@ -61,6 +65,7 @@ class RuleStopState(ATNState): def __init__(self) -> None: ... class RuleStartState(ATNState): + __slots__ = ("stopState", "isPrecedenceRule") stateType: Incomplete stopState: Incomplete isPrecedenceRule: bool @@ -71,6 +76,7 @@ class PlusLoopbackState(DecisionState): def __init__(self) -> None: ... class PlusBlockStartState(BlockStartState): + __slots__ = "loopBackState" stateType: Incomplete loopBackState: Incomplete def __init__(self) -> None: ... @@ -84,12 +90,14 @@ class StarLoopbackState(ATNState): def __init__(self) -> None: ... class StarLoopEntryState(DecisionState): + __slots__ = ("loopBackState", "isPrecedenceDecision") stateType: Incomplete loopBackState: Incomplete isPrecedenceDecision: Incomplete def __init__(self) -> None: ... class LoopEndState(ATNState): + __slots__ = "loopBackState" stateType: Incomplete loopBackState: Incomplete def __init__(self) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/LexerATNSimulator.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/LexerATNSimulator.pyi index f7bd7e42de2b..0a00ea8445ff 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/LexerATNSimulator.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/LexerATNSimulator.pyi @@ -22,6 +22,7 @@ from antlr4.PredictionContext import ( from antlr4.Token import Token as Token class SimState: + __slots__ = ("index", "line", "column", "dfaState") def __init__(self) -> None: ... index: int line: int @@ -30,6 +31,7 @@ class SimState: def reset(self) -> None: ... class LexerATNSimulator(ATNSimulator): + __slots__ = ("decisionToDFA", "recog", "startIndex", "line", "column", "mode", "DEFAULT_MODE", "MAX_CHAR_VALUE", "prevAccept") debug: bool dfa_debug: bool MIN_DFA_EDGE: int diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/LexerAction.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/LexerAction.pyi index 4e97dd9e548f..255a96f31eb8 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/LexerAction.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/LexerAction.pyi @@ -14,6 +14,7 @@ class LexerActionType(IntEnum): TYPE = 7 class LexerAction: + __slots__ = ("actionType", "isPositionDependent") actionType: Incomplete isPositionDependent: bool def __init__(self, action: LexerActionType) -> None: ... @@ -26,6 +27,7 @@ class LexerSkipAction(LexerAction): def execute(self, lexer: Lexer): ... class LexerTypeAction(LexerAction): + __slots__ = "type" type: Incomplete def __init__(self, type: int) -> None: ... def execute(self, lexer: Lexer): ... @@ -33,6 +35,7 @@ class LexerTypeAction(LexerAction): def __eq__(self, other): ... class LexerPushModeAction(LexerAction): + __slots__ = "mode" mode: Incomplete def __init__(self, mode: int) -> None: ... def execute(self, lexer: Lexer): ... @@ -50,6 +53,7 @@ class LexerMoreAction(LexerAction): def execute(self, lexer: Lexer): ... class LexerModeAction(LexerAction): + __slots__ = "mode" mode: Incomplete def __init__(self, mode: int) -> None: ... def execute(self, lexer: Lexer): ... @@ -57,6 +61,7 @@ class LexerModeAction(LexerAction): def __eq__(self, other): ... class LexerCustomAction(LexerAction): + __slots__ = ("ruleIndex", "actionIndex") ruleIndex: Incomplete actionIndex: Incomplete isPositionDependent: bool @@ -66,6 +71,7 @@ class LexerCustomAction(LexerAction): def __eq__(self, other): ... class LexerChannelAction(LexerAction): + __slots__ = "channel" channel: Incomplete def __init__(self, channel: int) -> None: ... def execute(self, lexer: Lexer): ... @@ -73,6 +79,7 @@ class LexerChannelAction(LexerAction): def __eq__(self, other): ... class LexerIndexedCustomAction(LexerAction): + __slots__ = ("offset", "action") offset: Incomplete action: Incomplete isPositionDependent: bool diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/LexerActionExecutor.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/LexerActionExecutor.pyi index 2cfa6d63c2de..ff09dd23e400 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/LexerActionExecutor.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/LexerActionExecutor.pyi @@ -4,6 +4,7 @@ from antlr4.atn.LexerAction import LexerAction as LexerAction, LexerIndexedCusto from antlr4.InputStream import InputStream as InputStream class LexerActionExecutor: + __slots__ = ("lexerActions", "hashCode") lexerActions: Incomplete hashCode: Incomplete def __init__(self, lexerActions: list[LexerAction] = []) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/ParserATNSimulator.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/ParserATNSimulator.pyi index 824700785e60..aa990870ce3c 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/ParserATNSimulator.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/ParserATNSimulator.pyi @@ -34,6 +34,7 @@ from antlr4.Token import Token as Token from antlr4.Utils import str_list as str_list class ParserATNSimulator(ATNSimulator): + __slots__ = ("parser", "decisionToDFA", "predictionMode", "_input", "_startIndex", "_outerContext", "_dfa", "mergeCache") debug: bool trace_atn_sim: bool dfa_debug: bool diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/SemanticContext.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/SemanticContext.pyi index 7fb59cd568f0..01f9acf5b0af 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/SemanticContext.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/SemanticContext.pyi @@ -15,6 +15,7 @@ def filterPrecedencePredicates(collection: set[SemanticContext]): ... class EmptySemanticContext(SemanticContext): ... class Predicate(SemanticContext): + __slots__ = ("ruleIndex", "predIndex", "isCtxDependent") ruleIndex: Incomplete predIndex: Incomplete isCtxDependent: Incomplete @@ -33,6 +34,7 @@ class PrecedencePredicate(SemanticContext): def __eq__(self, other): ... class AND(SemanticContext): + __slots__ = "opnds" opnds: Incomplete def __init__(self, a: SemanticContext, b: SemanticContext) -> None: ... def __eq__(self, other): ... @@ -41,6 +43,7 @@ class AND(SemanticContext): def evalPrecedence(self, parser: Recognizer, outerContext: RuleContext): ... class OR(SemanticContext): + __slots__ = "opnds" opnds: Incomplete def __init__(self, a: SemanticContext, b: SemanticContext) -> None: ... def __eq__(self, other): ... diff --git a/stubs/antlr4-python3-runtime/antlr4/atn/Transition.pyi b/stubs/antlr4-python3-runtime/antlr4/atn/Transition.pyi index 9e2a8a57bcde..608da7480780 100644 --- a/stubs/antlr4-python3-runtime/antlr4/atn/Transition.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/atn/Transition.pyi @@ -4,6 +4,7 @@ from antlr4.atn.ATNState import RuleStartState from antlr4.IntervalSet import IntervalSet class Transition: + __slots__ = ("target", "isEpsilon", "label") EPSILON: int RANGE: int RULE: int @@ -22,6 +23,7 @@ class Transition: def __init__(self, target) -> None: ... class AtomTransition(Transition): + __slots__ = ("label_", "serializationType") label_: Incomplete label: Incomplete serializationType: Incomplete @@ -30,6 +32,7 @@ class AtomTransition(Transition): def matches(self, symbol: int, minVocabSymbol: int, maxVocabSymbol: int): ... class RuleTransition(Transition): + __slots__ = ("ruleIndex", "precedence", "followState", "serializationType") ruleIndex: Incomplete precedence: Incomplete followState: Incomplete @@ -39,6 +42,7 @@ class RuleTransition(Transition): def matches(self, symbol: int, minVocabSymbol: int, maxVocabSymbol: int): ... class EpsilonTransition(Transition): + __slots__ = ("serializationType", "outermostPrecedenceReturn") serializationType: Incomplete isEpsilon: bool outermostPrecedenceReturn: Incomplete @@ -46,6 +50,7 @@ class EpsilonTransition(Transition): def matches(self, symbol: int, minVocabSymbol: int, maxVocabSymbol: int): ... class RangeTransition(Transition): + __slots__ = ("serializationType", "start", "stop") serializationType: Incomplete start: Incomplete stop: Incomplete @@ -58,6 +63,7 @@ class AbstractPredicateTransition(Transition): def __init__(self, target) -> None: ... class PredicateTransition(AbstractPredicateTransition): + __slots__ = ("serializationType", "ruleIndex", "predIndex", "isCtxDependent") serializationType: Incomplete ruleIndex: Incomplete predIndex: Incomplete @@ -68,6 +74,7 @@ class PredicateTransition(AbstractPredicateTransition): def getPredicate(self): ... class ActionTransition(Transition): + __slots__ = ("serializationType", "ruleIndex", "actionIndex", "isCtxDependent") serializationType: Incomplete ruleIndex: Incomplete actionIndex: Incomplete @@ -77,6 +84,7 @@ class ActionTransition(Transition): def matches(self, symbol: int, minVocabSymbol: int, maxVocabSymbol: int): ... class SetTransition(Transition): + __slots__ = "serializationType" serializationType: Incomplete label: Incomplete def __init__(self, target, set: IntervalSet) -> None: ... @@ -88,11 +96,13 @@ class NotSetTransition(SetTransition): def matches(self, symbol: int, minVocabSymbol: int, maxVocabSymbol: int): ... class WildcardTransition(Transition): + __slots__ = "serializationType" serializationType: Incomplete def __init__(self, target) -> None: ... def matches(self, symbol: int, minVocabSymbol: int, maxVocabSymbol: int): ... class PrecedencePredicateTransition(AbstractPredicateTransition): + __slots__ = ("serializationType", "precedence") serializationType: Incomplete precedence: Incomplete isEpsilon: bool diff --git a/stubs/antlr4-python3-runtime/antlr4/dfa/DFA.pyi b/stubs/antlr4-python3-runtime/antlr4/dfa/DFA.pyi index 86abf9a72b44..b18b49cb941d 100644 --- a/stubs/antlr4-python3-runtime/antlr4/dfa/DFA.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/dfa/DFA.pyi @@ -6,6 +6,7 @@ from antlr4.dfa.DFAState import DFAState as DFAState from antlr4.error.Errors import IllegalStateException as IllegalStateException class DFA: + __slots__ = ("atnStartState", "decision", "_states", "s0", "precedenceDfa") atnStartState: Incomplete decision: Incomplete s0: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/dfa/DFASerializer.pyi b/stubs/antlr4-python3-runtime/antlr4/dfa/DFASerializer.pyi index 6d9aac86d3d2..efd431df7eaf 100644 --- a/stubs/antlr4-python3-runtime/antlr4/dfa/DFASerializer.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/dfa/DFASerializer.pyi @@ -5,6 +5,7 @@ from antlr4.dfa.DFAState import DFAState as DFAState from antlr4.Utils import str_list as str_list class DFASerializer: + __slots__ = ("dfa", "literalNames", "symbolicNames") dfa: Incomplete literalNames: list[str] | None symbolicNames: list[str] | None diff --git a/stubs/antlr4-python3-runtime/antlr4/dfa/DFAState.pyi b/stubs/antlr4-python3-runtime/antlr4/dfa/DFAState.pyi index d70d1a38c7b2..55eff18b7840 100644 --- a/stubs/antlr4-python3-runtime/antlr4/dfa/DFAState.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/dfa/DFAState.pyi @@ -4,11 +4,22 @@ from antlr4.atn.ATNConfigSet import ATNConfigSet as ATNConfigSet from antlr4.atn.SemanticContext import SemanticContext as SemanticContext class PredPrediction: + __slots__ = ("alt", "pred") alt: Incomplete pred: Incomplete def __init__(self, pred: SemanticContext, alt: int) -> None: ... class DFAState: + __slots__ = ( + "stateNumber", + "configs", + "edges", + "isAcceptState", + "prediction", + "lexerActionExecutor", + "requiresFullContext", + "predicates", + ) stateNumber: Incomplete configs: Incomplete edges: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/tree/Chunk.pyi b/stubs/antlr4-python3-runtime/antlr4/tree/Chunk.pyi index a8f1b30f938f..be68b31898e7 100644 --- a/stubs/antlr4-python3-runtime/antlr4/tree/Chunk.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/tree/Chunk.pyi @@ -3,10 +3,12 @@ from _typeshed import Incomplete class Chunk: ... class TagChunk(Chunk): + __slots__ = ("tag", "label") tag: Incomplete label: Incomplete def __init__(self, tag: str, label: str | None = None) -> None: ... class TextChunk(Chunk): + __slots__ = "text" text: Incomplete def __init__(self, text: str) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreeMatch.pyi b/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreeMatch.pyi index 23e09c3dd752..71b3dd76899e 100644 --- a/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreeMatch.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreeMatch.pyi @@ -4,6 +4,7 @@ from antlr4.tree.ParseTreePattern import ParseTreePattern as ParseTreePattern from antlr4.tree.Tree import ParseTree as ParseTree class ParseTreeMatch: + __slots__ = ("tree", "pattern", "labels", "mismatchedNode") tree: Incomplete pattern: Incomplete labels: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePattern.pyi b/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePattern.pyi index d50da5c95c09..ef542c0e1288 100644 --- a/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePattern.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePattern.pyi @@ -5,6 +5,7 @@ from antlr4.tree.Tree import ParseTree as ParseTree from antlr4.xpath.XPathLexer import XPathLexer as XPathLexer class ParseTreePattern: + __slots__ = ("matcher", "patternRuleIndex", "pattern", "patternTree") matcher: Incomplete patternRuleIndex: Incomplete pattern: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePatternMatcher.pyi b/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePatternMatcher.pyi index 392d7be9b31b..0d94f19c0ec0 100644 --- a/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePatternMatcher.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/tree/ParseTreePatternMatcher.pyi @@ -25,6 +25,7 @@ class CannotInvokeStartRule(Exception): class StartRuleDoesNotConsumeFullPattern(Exception): ... class ParseTreePatternMatcher: + __slots__ = ("lexer", "parser", "start", "stop", "escape") lexer: Incomplete parser: Incomplete start: str diff --git a/stubs/antlr4-python3-runtime/antlr4/tree/RuleTagToken.pyi b/stubs/antlr4-python3-runtime/antlr4/tree/RuleTagToken.pyi index 12358ca0b9d8..0594ab3c4f37 100644 --- a/stubs/antlr4-python3-runtime/antlr4/tree/RuleTagToken.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/tree/RuleTagToken.pyi @@ -3,6 +3,7 @@ from _typeshed import Incomplete from antlr4.Token import Token as Token class RuleTagToken(Token): + __slots__ = ("label", "ruleName") source: Incomplete type: Incomplete channel: Incomplete diff --git a/stubs/antlr4-python3-runtime/antlr4/tree/TokenTagToken.pyi b/stubs/antlr4-python3-runtime/antlr4/tree/TokenTagToken.pyi index ff76088ca935..902d685b8418 100644 --- a/stubs/antlr4-python3-runtime/antlr4/tree/TokenTagToken.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/tree/TokenTagToken.pyi @@ -3,6 +3,7 @@ from _typeshed import Incomplete from antlr4.Token import CommonToken as CommonToken class TokenTagToken(CommonToken): + __slots__ = ("tokenName", "label") tokenName: Incomplete label: Incomplete def __init__(self, tokenName: str, type: int, label: str | None = None) -> None: ... diff --git a/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi b/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi index 8ec130b45133..c50e70da5897 100644 --- a/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi +++ b/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi @@ -27,6 +27,7 @@ class ParseTreeListener: def exitEveryRule(self, ctx): ... class TerminalNodeImpl(TerminalNode): + __slots__ = ("parentCtx", "symbol") parentCtx: Incomplete symbol: Incomplete def __init__(self, symbol: Token) -> None: ... diff --git a/stubs/boltons/boltons/dictutils.pyi b/stubs/boltons/boltons/dictutils.pyi index d57469749539..1ade1c0e1891 100644 --- a/stubs/boltons/boltons/dictutils.pyi +++ b/stubs/boltons/boltons/dictutils.pyi @@ -51,6 +51,7 @@ class FastIterOrderedMultiDict(OrderedMultiDict[_KT, _VT]): # undocumented def iterkeys(self, multi: bool = False) -> Generator[_KT, None, None]: ... class OneToOne(dict[_KT, _VT]): + __slots__ = ("inv",) inv: OneToOne[_VT, _KT] def clear(self) -> None: ... def copy(self) -> Self: ... @@ -87,6 +88,7 @@ def subdict(d: dict[_KT, _VT], keep: Iterable[_KT] | None = None, drop: Iterable class FrozenHashError(TypeError): ... # undocumented class FrozenDict(dict[_KT, _VT]): + __slots__ = ("_hash",) def __copy__(self) -> Self: ... @classmethod def fromkeys(cls, keys: Iterable[_KT], value: _VT | None = None) -> Self: ... # type: ignore[override] diff --git a/stubs/boltons/boltons/mathutils.pyi b/stubs/boltons/boltons/mathutils.pyi index e74ca0e8d2fe..843e8fcd0412 100644 --- a/stubs/boltons/boltons/mathutils.pyi +++ b/stubs/boltons/boltons/mathutils.pyi @@ -12,6 +12,7 @@ def floor(x: float, options: None = None) -> int: ... def floor(x: float, options: Iterable[float]) -> float: ... class Bits: + __slots__ = ("val", "len") val: int len: int def __init__(self, val: int | list[bool] | str | bytes = 0, len_: int | None = None) -> None: ... diff --git a/stubs/boltons/boltons/setutils.pyi b/stubs/boltons/boltons/setutils.pyi index 47a9cfe4f43b..d86104518841 100644 --- a/stubs/boltons/boltons/setutils.pyi +++ b/stubs/boltons/boltons/setutils.pyi @@ -59,6 +59,7 @@ class IndexedSet(MutableSet[Any]): def complement(wrapped: Iterable[Any]) -> _ComplementSet: ... class _ComplementSet: + __slots__ = ("_included", "_excluded") def __init__( self, included: set[Any] | frozenset[Any] | None = None, excluded: set[Any] | frozenset[Any] | None = None ) -> None: ... diff --git a/stubs/boltons/boltons/tbutils.pyi b/stubs/boltons/boltons/tbutils.pyi index a1fb06843031..1d4648d6f129 100644 --- a/stubs/boltons/boltons/tbutils.pyi +++ b/stubs/boltons/boltons/tbutils.pyi @@ -4,6 +4,7 @@ from typing import Any, Generic, Literal, TypeVar from typing_extensions import Self class Callpoint: + __slots__ = ("func_name", "lineno", "module_name", "module_path", "lasti", "line") func_name: str lineno: int module_name: str diff --git a/stubs/cffi/cffi/backend_ctypes.pyi b/stubs/cffi/cffi/backend_ctypes.pyi index 7faef0c73d59..0addca928780 100644 --- a/stubs/cffi/cffi/backend_ctypes.pyi +++ b/stubs/cffi/cffi/backend_ctypes.pyi @@ -9,6 +9,7 @@ bytechr: Callable[[float], bytes] class CTypesType(type): ... class CTypesData: + __slots__ = ["__weakref__"] __metaclass__: Incomplete __name__: str def __init__(self, *args) -> None: ... @@ -23,17 +24,21 @@ class CTypesData: def __repr__(self, c_name: str | None = None): ... class CTypesGenericPrimitive(CTypesData): + __slots__ = [] def __hash__(self) -> int: ... class CTypesGenericArray(CTypesData): + __slots__ = [] def __iter__(self): ... class CTypesGenericPtr(CTypesData): + __slots__ = ["_address", "_as_ctype_ptr"] kind: str def __nonzero__(self) -> bool: ... def __bool__(self) -> bool: ... -class CTypesBaseStructOrUnion(CTypesData): ... +class CTypesBaseStructOrUnion(CTypesData): + __slots__ = ["_blob"] class CTypesBackend: PRIMITIVE_TYPES: Incomplete diff --git a/stubs/defusedxml/defusedxml/lxml.pyi b/stubs/defusedxml/defusedxml/lxml.pyi index 77f1de2d4b97..ab9922e4684e 100644 --- a/stubs/defusedxml/defusedxml/lxml.pyi +++ b/stubs/defusedxml/defusedxml/lxml.pyi @@ -28,6 +28,7 @@ def tostring( class _ElementBase: ... class RestrictedElement(_ElementBase): + __slots__ = () blacklist: Incomplete def __iter__(self): ... def iterchildren(self, tag: Incomplete | None = ..., reversed: bool = ...): ... diff --git a/stubs/docutils/docutils/utils/_roman_numerals.pyi b/stubs/docutils/docutils/utils/_roman_numerals.pyi index 1dd10efcc8f9..0d7b27baff83 100644 --- a/stubs/docutils/docutils/utils/_roman_numerals.pyi +++ b/stubs/docutils/docutils/utils/_roman_numerals.pyi @@ -15,6 +15,7 @@ class InvalidRomanNumeralError(ValueError): @final class RomanNumeral: + __slots__ = ("_value",) def __init__(self, value: int, /) -> None: ... def __int__(self) -> int: ... def __eq__(self, other: object) -> bool: ... diff --git a/stubs/fpdf2/fpdf/annotations.pyi b/stubs/fpdf2/fpdf/annotations.pyi index 351f46fa9edd..b55b30978dff 100644 --- a/stubs/fpdf2/fpdf/annotations.pyi +++ b/stubs/fpdf2/fpdf/annotations.pyi @@ -55,6 +55,26 @@ class AnnotationMixin: class PDFAnnotation(AnnotationMixin, PDFObject): ... class AnnotationDict(AnnotationMixin): + __slots__ = ( + "type", + "subtype", + "rect", + "border", + "f_t", + "v", + "f", + "contents", + "a", + "dest", + "c", + "t", + "quad_points", + "p", + "name", + "ink_list", + "f_s", + "d_a", + ) def serialize(self) -> str: ... class PDFEmbeddedFile(PDFContentStream): diff --git a/stubs/fpdf2/fpdf/bidi.pyi b/stubs/fpdf2/fpdf/bidi.pyi index 3efbf7e65458..c748e733f349 100644 --- a/stubs/fpdf2/fpdf/bidi.pyi +++ b/stubs/fpdf2/fpdf/bidi.pyi @@ -15,6 +15,7 @@ class _BracketInfo(TypedDict): BIDI_BRACKETS: Final[dict[str, _BracketInfo]] class BidiCharacter: + __slots__ = ["character_index", "character", "bidi_class", "original_bidi_class", "embedding_level", "direction"] character_index: int character: str bidi_class: str @@ -28,11 +29,13 @@ class BidiCharacter: @dataclass class DirectionalStatus: + __slots__ = ["embedding_level", "directional_override_status", "directional_isolate_status"] embedding_level: int # between 0 and MAX_DEPTH directional_override_status: Literal["N", "L", "R"] directional_isolate_status: bool class IsolatingRun: + __slots__ = ["characters", "previous_direction", "next_direction"] characters: list[BidiCharacter] previous_direction: str next_direction: str @@ -46,6 +49,7 @@ def auto_detect_base_direction(string: str, stop_at_pdi: bool = False, debug: bo def calculate_isolate_runs(paragraph: Sequence[BidiCharacter]) -> list[IsolatingRun]: ... class BidiParagraph: + __slots__ = ("text", "base_direction", "debug", "base_embedding_level", "characters") text: str base_direction: TextDirection debug: bool diff --git a/stubs/fpdf2/fpdf/fonts.pyi b/stubs/fpdf2/fpdf/fonts.pyi index b508d6d97a26..72d97ebd1e73 100644 --- a/stubs/fpdf2/fpdf/fonts.pyi +++ b/stubs/fpdf2/fpdf/fonts.pyi @@ -20,6 +20,7 @@ class HarfBuzzFont(Incomplete): # derives from uharfbuzz.Font @dataclass class FontFace: + __slots__ = ("family", "emphasis", "size_pt", "color", "fill_color") family: str | None emphasis: TextEmphasis | None size_pt: int | None @@ -79,6 +80,7 @@ class TitleStyle(TextStyle): ... __pdoc__: Final[dict[str, bool]] class CoreFont: + __slots__ = ("i", "type", "name", "sp", "ss", "up", "ut", "cw", "fontkey", "emphasis") i: int type: str name: str @@ -94,6 +96,27 @@ class CoreFont: def encode_text(self, text: str) -> str: ... class TTFFont: + __slots__ = ( + "i", + "type", + "name", + "desc", + "glyph_ids", + "hbfont", + "sp", + "ss", + "up", + "ut", + "cw", + "ttffile", + "fontkey", + "emphasis", + "scale", + "subset", + "cmap", + "ttfont", + "missing_glyphs", + ) i: int type: str ttffile: Incomplete @@ -137,6 +160,7 @@ class PDFFontDescriptor(PDFObject): @dataclass(order=True) class Glyph: + __slots__ = ("glyph_id", "unicode", "glyph_name", "glyph_width") glyph_id: int unicode: tuple[Incomplete, ...] glyph_name: str diff --git a/stubs/fpdf2/fpdf/outline.pyi b/stubs/fpdf2/fpdf/outline.pyi index 52ceb7eff68d..4a26d8ee0982 100644 --- a/stubs/fpdf2/fpdf/outline.pyi +++ b/stubs/fpdf2/fpdf/outline.pyi @@ -9,6 +9,7 @@ from .syntax import Destination, PDFObject, PDFString @dataclass class OutlineSection: + __slots__ = ("name", "level", "page_number", "dest", "struct_elem") name: str level: int page_number: int @@ -16,6 +17,7 @@ class OutlineSection: struct_elem: StructElem | None = None class OutlineItemDictionary(PDFObject): + __slots__ = ("_id", "title", "parent", "prev", "next", "first", "last", "count", "dest", "struct_elem") title: PDFString parent: Incomplete | None prev: Incomplete | None @@ -28,6 +30,7 @@ class OutlineItemDictionary(PDFObject): def __init__(self, title: str, dest: Destination | None = None, struct_elem: StructElem | None = None) -> None: ... class OutlineDictionary(PDFObject): + __slots__ = ("_id", "type", "first", "last", "count") type: str first: Incomplete | None last: Incomplete | None diff --git a/stubs/fpdf2/fpdf/output.pyi b/stubs/fpdf2/fpdf/output.pyi index fb963c770e04..86c1b56c855e 100644 --- a/stubs/fpdf2/fpdf/output.pyi +++ b/stubs/fpdf2/fpdf/output.pyi @@ -102,6 +102,21 @@ class PDFXmpMetadata(PDFContentStream): def __init__(self, contents: bytes) -> None: ... class PDFXObject(PDFContentStream): + __slots__ = ( + "_id", + "_contents", + "filter", + "length", + "type", + "subtype", + "width", + "height", + "color_space", + "bits_per_component", + "decode", + "decode_parms", + "s_mask", + ) type: Name subtype: Name width: Incomplete @@ -126,11 +141,13 @@ class PDFXObject(PDFContentStream): ) -> None: ... class PDFICCProfile(PDFContentStream): + __slots__ = ("_id", "_contents", "filter", "length", "n", "alternate") n: Incomplete alternate: Name def __init__(self, contents: bytes, n, alternate: str) -> None: ... class PDFPageLabel: + __slots__ = ("_style", "_prefix", "st") st: int def __init__(self, label_style: PageLabelStyle, label_prefix: str, label_start: int) -> None: ... @property @@ -143,6 +160,24 @@ class PDFPageLabel: def get_start(self) -> int: ... class PDFPage(PDFObject): + __slots__ = ( + "_id", + "type", + "contents", + "dur", + "trans", + "annots", + "group", + "media_box", + "struct_parents", + "resources", + "parent", + "_index", + "_width_pt", + "_height_pt", + "_page_label", + "_text_substitution_fragments", + ) type: Name contents: Incomplete dur: Incomplete | None @@ -184,6 +219,7 @@ class PDFXrefAndTrailer(ContentWithoutID): def serialize(self, _security_handler: StandardSecurityHandler | None = None) -> str: ... class OutputIntentDictionary: + __slots__ = ("type", "s", "output_condition_identifier", "output_condition", "registry_name", "dest_output_profile", "info") type: Name s: Name output_condition_identifier: PDFString | None diff --git a/stubs/fpdf2/fpdf/structure_tree.pyi b/stubs/fpdf2/fpdf/structure_tree.pyi index 3123d74fcdb5..6d3f35cd536f 100644 --- a/stubs/fpdf2/fpdf/structure_tree.pyi +++ b/stubs/fpdf2/fpdf/structure_tree.pyi @@ -6,17 +6,20 @@ from .encryption import StandardSecurityHandler from .syntax import PDFArray, PDFObject, PDFString class NumberTree(PDFObject): + __slots__ = ("_id", "nums") nums: defaultdict[Incomplete, list[Incomplete]] def __init__(self) -> None: ... def serialize(self, obj_dict: Unused = None, _security_handler: StandardSecurityHandler | None = None) -> str: ... class StructTreeRoot(PDFObject): + __slots__ = ("_id", "type", "parent_tree", "k") type: str parent_tree: NumberTree k: PDFArray[Incomplete] def __init__(self) -> None: ... class StructElem(PDFObject): + __slots__ = ("_id", "type", "s", "p", "k", "t", "alt", "pg", "_page_number") type: str s: str p: PDFObject diff --git a/stubs/fpdf2/fpdf/table.pyi b/stubs/fpdf2/fpdf/table.pyi index 6a05934bdd70..46276c07ddcf 100644 --- a/stubs/fpdf2/fpdf/table.pyi +++ b/stubs/fpdf2/fpdf/table.pyi @@ -105,6 +105,7 @@ class Row: @dataclass class Cell: + __slots__ = ("text", "align", "v_align", "style", "img", "img_fill_width", "colspan", "rowspan", "padding", "link", "border") text: str align: str | Align | None v_align: str | VAlign | None diff --git a/stubs/gevent/gevent/_abstract_linkable.pyi b/stubs/gevent/gevent/_abstract_linkable.pyi index cdf549b90cf3..5c312a96c763 100644 --- a/stubs/gevent/gevent/_abstract_linkable.pyi +++ b/stubs/gevent/gevent/_abstract_linkable.pyi @@ -4,6 +4,7 @@ from typing_extensions import Self from gevent.hub import Hub class AbstractLinkable: + __slots__ = ("hub", "_links", "_notifier", "_notify_all", "__weakref__") @property def hub(self) -> Hub | None: ... def __init__(self, hub: Hub | None = None) -> None: ... diff --git a/stubs/gevent/gevent/_fileobjectcommon.pyi b/stubs/gevent/gevent/_fileobjectcommon.pyi index 727dd29a95ce..d631fd0740f7 100644 --- a/stubs/gevent/gevent/_fileobjectcommon.pyi +++ b/stubs/gevent/gevent/_fileobjectcommon.pyi @@ -28,7 +28,8 @@ class FlushingBufferedWriter(io.BufferedWriter): ... class WriteallMixin: def writeall(self, b: ReadableBuffer, /) -> int: ... -class FileIO(io.FileIO): ... +class FileIO(io.FileIO): + __slots__ = () class WriteIsWriteallMixin(WriteallMixin): def write(self, b: ReadableBuffer, /) -> int: ... diff --git a/stubs/gevent/gevent/_ident.pyi b/stubs/gevent/gevent/_ident.pyi index 7c1bf6b8d319..e59d21de18cf 100644 --- a/stubs/gevent/gevent/_ident.pyi +++ b/stubs/gevent/gevent/_ident.pyi @@ -3,6 +3,7 @@ from weakref import ref @final class ValuedWeakRef(ref): + __slots__ = ("value",) value: Any @final diff --git a/stubs/gevent/gevent/_monitor.pyi b/stubs/gevent/gevent/_monitor.pyi index 782f99c5c5ca..3647e0f33f0d 100644 --- a/stubs/gevent/gevent/_monitor.pyi +++ b/stubs/gevent/gevent/_monitor.pyi @@ -19,6 +19,7 @@ def implementer(interface: Any, /) -> Callable[[_T], _T]: ... class MonitorWarning(RuntimeWarning): ... class _MonitorEntry: + __slots__ = ("function", "period", "last_run_time") function: Callable[[Hub], object] period: float last_run_time: float diff --git a/stubs/gevent/gevent/_threading.pyi b/stubs/gevent/gevent/_threading.pyi index 0eeaaf454716..1c671bdec7f9 100644 --- a/stubs/gevent/gevent/_threading.pyi +++ b/stubs/gevent/gevent/_threading.pyi @@ -9,6 +9,7 @@ _Cookie = NewType("_Cookie", LockType) class EmptyTimeout(Exception): ... class Queue(Generic[_T]): + __slots__ = ("_queue", "_mutex", "_not_empty", "unfinished_tasks") unfinished_tasks: int def __init__(self) -> None: ... def task_done(self) -> None: ... diff --git a/stubs/gevent/gevent/_waiter.pyi b/stubs/gevent/gevent/_waiter.pyi index 23158d120c33..a240f02585bf 100644 --- a/stubs/gevent/gevent/_waiter.pyi +++ b/stubs/gevent/gevent/_waiter.pyi @@ -21,6 +21,7 @@ _ThrowArgs: TypeAlias = ( ) class Waiter(Generic[_T]): + __slots__ = ["hub", "greenlet", "value", "_exception"] @property def hub(self) -> Hub: ... # readonly in Cython @property @@ -42,4 +43,5 @@ class Waiter(Generic[_T]): def __call__(self, source: _ValueSource[_T]) -> None: ... @final -class MultipleWaiter(Waiter[_T]): ... +class MultipleWaiter(Waiter[_T]): + __slots__ = ["_values"] diff --git a/stubs/gevent/gevent/event.pyi b/stubs/gevent/gevent/event.pyi index 6a3211b49fec..d5570b019301 100644 --- a/stubs/gevent/gevent/event.pyi +++ b/stubs/gevent/gevent/event.pyi @@ -20,6 +20,7 @@ class _ValueSource(Protocol[_T_co]): def exception(self) -> BaseException | None: ... class Event(AbstractLinkable): + __slots__ = ("_flag",) def __init__(self) -> None: ... def is_set(self) -> bool: ... def isSet(self) -> bool: ... @@ -32,6 +33,7 @@ class Event(AbstractLinkable): def wait(self, timeout: float) -> bool: ... class AsyncResult(AbstractLinkable, Generic[_T]): + __slots__ = ("_value", "_exc_info", "_imap_task_index") def __init__(self) -> None: ... @property def value(self) -> _T | None: ... diff --git a/stubs/gevent/gevent/hub.pyi b/stubs/gevent/gevent/hub.pyi index 84ec26d9a933..02631bff6f27 100644 --- a/stubs/gevent/gevent/hub.pyi +++ b/stubs/gevent/gevent/hub.pyi @@ -105,6 +105,7 @@ class Hub(WaitOperationsGreenlet): threadpool: _DefaultReturnProperty[ThreadPool] class linkproxy: + __slots__ = ["callback", "obj"] callback: Callable[[object], object] obj: object def __init__(self, callback: Callable[[_T], object], obj: _T) -> None: ... diff --git a/stubs/gevent/gevent/local.pyi b/stubs/gevent/gevent/local.pyi index 1fe8911f581b..30b149cbf3c5 100644 --- a/stubs/gevent/gevent/local.pyi +++ b/stubs/gevent/gevent/local.pyi @@ -2,6 +2,15 @@ from typing import Any from typing_extensions import Self class local: + __slots__ = ( + "_local__impl", + "_local_type_set_descriptors", + "_local_type_get_descriptors", + "_local_type_vars", + "_local_type_del_descriptors", + "_local_type", + "_local_type_set_or_del_descriptors", + ) def __init__(self, *args: object, **kwargs: object) -> None: ... def __copy__(self) -> Self: ... def __getattribute__(self, name: str, /) -> Any: ... diff --git a/stubs/gevent/gevent/lock.pyi b/stubs/gevent/gevent/lock.pyi index 2daa782741fa..80cb2342f661 100644 --- a/stubs/gevent/gevent/lock.pyi +++ b/stubs/gevent/gevent/lock.pyi @@ -8,6 +8,7 @@ from gevent.hub import Hub __all__ = ["Semaphore", "BoundedSemaphore", "DummySemaphore", "RLock"] class Semaphore(AbstractLinkable): + __slots__ = ("counter", "_multithreaded") counter: int def __init__(self, value: int = 1, hub: Hub | None = None) -> None: ... def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... @@ -18,7 +19,8 @@ class Semaphore(AbstractLinkable): def __enter__(self) -> None: ... def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... -class BoundedSemaphore(Semaphore): ... +class BoundedSemaphore(Semaphore): + __slots__ = ("_initial_value",) class DummySemaphore: def __init__(self, value: int | None = None) -> None: ... @@ -33,6 +35,7 @@ class DummySemaphore: def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... class RLock: + __slots__ = ("_block", "_owner", "_count", "__weakref__") def __init__(self, hub: Hub | None = None) -> None: ... def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... def __enter__(self) -> bool: ... diff --git a/stubs/gevent/gevent/pool.pyi b/stubs/gevent/gevent/pool.pyi index ffda747048a0..7ced638ddf70 100644 --- a/stubs/gevent/gevent/pool.pyi +++ b/stubs/gevent/gevent/pool.pyi @@ -18,6 +18,7 @@ _S = TypeVar("_S") _P = ParamSpec("_P") class GroupMappingMixin: + __slots__ = () def spawn(self, func: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Greenlet[_P, _T]: ... # we would like to use ParamSpec for these, but since args and kwds are passed in as is # pyright will complain if we use _P.args/_P.kwargs, it appears to work on mypy though diff --git a/stubs/gevent/gevent/pywsgi.pyi b/stubs/gevent/gevent/pywsgi.pyi index 2d014a042a99..3d9400c6431f 100644 --- a/stubs/gevent/gevent/pywsgi.pyi +++ b/stubs/gevent/gevent/pywsgi.pyi @@ -23,6 +23,16 @@ class _LogOutputStream(SupportsWrite[str], Protocol): def flush(self) -> None: ... class Input: + __slots__ = ( + "rfile", + "content_length", + "socket", + "position", + "chunked_input", + "chunk_length", + "_chunked_input_error", + "send_100_continue_enabled", + ) rfile: BufferedReader content_length: int | None socket: _GeventSocket | None @@ -103,6 +113,7 @@ class WSGIHandler: def get_environ(self) -> WSGIEnvironment: ... class LoggingLogAdapter: + __slots__ = ("_logger", "_level") def __init__(self, logger: Logger, level: int = 20) -> None: ... def write(self, msg: str) -> None: ... def flush(self) -> None: ... @@ -111,9 +122,11 @@ class LoggingLogAdapter: def __setattr__(self, name: str, value: object) -> None: ... def __delattr__(self, name: str) -> None: ... -class Environ(WSGIEnvironment): ... +class Environ(WSGIEnvironment): + __slots__ = () class SecureEnviron(Environ): + __slots__ = ("secure_repr", "whitelist_keys", "print_masked_keys") default_secure_repr: ClassVar[bool] default_whitelist_keys: ClassVar[Container[str]] default_print_masked_keys: ClassVar[bool] diff --git a/stubs/gevent/gevent/queue.pyi b/stubs/gevent/gevent/queue.pyi index b95cb5212be6..e0a504edba15 100644 --- a/stubs/gevent/gevent/queue.pyi +++ b/stubs/gevent/gevent/queue.pyi @@ -21,6 +21,7 @@ else: _T = TypeVar("_T") class SimpleQueue(Generic[_T]): + __slots__ = ("_maxsize", "getters", "putters", "hub", "_event_unlock", "queue", "__weakref__", "is_shutdown") @property def hub(self) -> Hub: ... # readonly in Cython @property @@ -53,6 +54,7 @@ class SimpleQueue(Generic[_T]): next = __next__ class Queue(SimpleQueue[_T]): + __slots__ = ("_cond", "unfinished_tasks") @property def unfinished_tasks(self) -> int: ... # readonly in Cython @overload @@ -69,6 +71,7 @@ JoinableQueue = Queue @final class UnboundQueue(Queue[_T]): + __slots__ = () @overload def __init__(self, maxsize: None = None) -> None: ... @overload @@ -76,10 +79,14 @@ class UnboundQueue(Queue[_T]): @overload def __init__(self, maxsize: None = None, *, items: Iterable[_T]) -> None: ... -class PriorityQueue(Queue[_T]): ... -class LifoQueue(Queue[_T]): ... +class PriorityQueue(Queue[_T]): + __slots__ = () + +class LifoQueue(Queue[_T]): + __slots__ = () class Channel(Generic[_T]): + __slots__ = ("getters", "putters", "hub", "_event_unlock", "__weakref__") @property def getters(self) -> deque[Waiter[Any]]: ... # readonly in Cython @property diff --git a/stubs/gevent/gevent/threadpool.pyi b/stubs/gevent/gevent/threadpool.pyi index e65c64cb2d1f..3ce23ac79fb6 100644 --- a/stubs/gevent/gevent/threadpool.pyi +++ b/stubs/gevent/gevent/threadpool.pyi @@ -16,6 +16,17 @@ _TaskItem: TypeAlias = tuple[Callable[..., Any], tuple[Any, ...], dict[str, Any] _Receiver: TypeAlias = Callable[[_ValueSource[_T]], object] class ThreadPool(GroupMappingMixin): + __slots__ = ( + "hub", + "_maxsize", + "manager", + "pid", + "fork_watcher", + "_available_worker_threads_greenlet_sem", + "_worker_greenlets", + "task_queue", + "_idle_task_timeout", + ) hub: Hub pid: int manager: Greenlet[..., Any] | None @@ -37,6 +48,7 @@ class ThreadPool(GroupMappingMixin): def spawn(self, func: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> AsyncResult[_T]: ... # type: ignore[override] class ThreadResult(Generic[_T]): + __slots__ = ("exc_info", "async_watcher", "_call_when_ready", "value", "context", "hub", "receiver") receiver: _Receiver[_T] hub: Hub context: object | None diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi index 262fa0f3f89c..adf248e386f4 100644 --- a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi @@ -10,6 +10,7 @@ DESCRIPTOR: FileDescriptor @final class Channel(message.Message, metaclass=MessageMeta): + __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] CHANNEL_REF_FIELD_NUMBER: ClassVar[int] @@ -32,6 +33,7 @@ class Channel(message.Message, metaclass=MessageMeta): @final class Subchannel(message.Message, metaclass=MessageMeta): + __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] CHANNEL_REF_FIELD_NUMBER: ClassVar[int] @@ -54,6 +56,7 @@ class Subchannel(message.Message, metaclass=MessageMeta): @final class ChannelConnectivityState(message.Message, metaclass=MessageMeta): + __slots__ = () State: Incomplete UNKNOWN: Incomplete IDLE: Incomplete @@ -68,6 +71,7 @@ class ChannelConnectivityState(message.Message, metaclass=MessageMeta): @final class ChannelData(message.Message, metaclass=MessageMeta): + __slots__ = () STATE_FIELD_NUMBER: ClassVar[int] TARGET_FIELD_NUMBER: ClassVar[int] TRACE_FIELD_NUMBER: ClassVar[int] @@ -96,6 +100,7 @@ class ChannelData(message.Message, metaclass=MessageMeta): @final class ChannelTraceEvent(message.Message, metaclass=MessageMeta): + __slots__ = () Severity: Incomplete CT_UNKNOWN: Incomplete CT_INFO: Incomplete @@ -123,6 +128,7 @@ class ChannelTraceEvent(message.Message, metaclass=MessageMeta): @final class ChannelTrace(message.Message, metaclass=MessageMeta): + __slots__ = () NUM_EVENTS_LOGGED_FIELD_NUMBER: ClassVar[int] CREATION_TIMESTAMP_FIELD_NUMBER: ClassVar[int] EVENTS_FIELD_NUMBER: ClassVar[int] @@ -139,6 +145,7 @@ class ChannelTrace(message.Message, metaclass=MessageMeta): @final class ChannelRef(message.Message, metaclass=MessageMeta): + __slots__ = () CHANNEL_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] channel_id: int @@ -148,6 +155,7 @@ class ChannelRef(message.Message, metaclass=MessageMeta): @final class SubchannelRef(message.Message, metaclass=MessageMeta): + __slots__ = () SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] subchannel_id: int @@ -157,6 +165,7 @@ class SubchannelRef(message.Message, metaclass=MessageMeta): @final class SocketRef(message.Message, metaclass=MessageMeta): + __slots__ = () SOCKET_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] socket_id: int @@ -166,6 +175,7 @@ class SocketRef(message.Message, metaclass=MessageMeta): @final class ServerRef(message.Message, metaclass=MessageMeta): + __slots__ = () SERVER_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] server_id: int @@ -175,6 +185,7 @@ class ServerRef(message.Message, metaclass=MessageMeta): @final class Server(message.Message, metaclass=MessageMeta): + __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] LISTEN_SOCKET_FIELD_NUMBER: ClassVar[int] @@ -191,6 +202,7 @@ class Server(message.Message, metaclass=MessageMeta): @final class ServerData(message.Message, metaclass=MessageMeta): + __slots__ = () TRACE_FIELD_NUMBER: ClassVar[int] CALLS_STARTED_FIELD_NUMBER: ClassVar[int] CALLS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] @@ -213,6 +225,7 @@ class ServerData(message.Message, metaclass=MessageMeta): @final class Socket(message.Message, metaclass=MessageMeta): + __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] LOCAL_FIELD_NUMBER: ClassVar[int] @@ -238,6 +251,7 @@ class Socket(message.Message, metaclass=MessageMeta): @final class SocketData(message.Message, metaclass=MessageMeta): + __slots__ = () STREAMS_STARTED_FIELD_NUMBER: ClassVar[int] STREAMS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] STREAMS_FAILED_FIELD_NUMBER: ClassVar[int] @@ -284,8 +298,10 @@ class SocketData(message.Message, metaclass=MessageMeta): @final class Address(message.Message, metaclass=MessageMeta): + __slots__ = () @final class TcpIpAddress(message.Message, metaclass=MessageMeta): + __slots__ = () IP_ADDRESS_FIELD_NUMBER: ClassVar[int] PORT_FIELD_NUMBER: ClassVar[int] ip_address: bytes @@ -294,12 +310,14 @@ class Address(message.Message, metaclass=MessageMeta): @final class UdsAddress(message.Message, metaclass=MessageMeta): + __slots__ = () FILENAME_FIELD_NUMBER: ClassVar[int] filename: str def __init__(self, filename: str | None = ...) -> None: ... @final class OtherAddress(message.Message, metaclass=MessageMeta): + __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] name: str @@ -322,8 +340,10 @@ class Address(message.Message, metaclass=MessageMeta): @final class Security(message.Message, metaclass=MessageMeta): + __slots__ = () @final class Tls(message.Message, metaclass=MessageMeta): + __slots__ = () STANDARD_NAME_FIELD_NUMBER: ClassVar[int] OTHER_NAME_FIELD_NUMBER: ClassVar[int] LOCAL_CERTIFICATE_FIELD_NUMBER: ClassVar[int] @@ -342,6 +362,7 @@ class Security(message.Message, metaclass=MessageMeta): @final class OtherSecurity(message.Message, metaclass=MessageMeta): + __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] name: str @@ -361,6 +382,7 @@ class Security(message.Message, metaclass=MessageMeta): @final class SocketOption(message.Message, metaclass=MessageMeta): + __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] ADDITIONAL_FIELD_NUMBER: ClassVar[int] @@ -377,6 +399,7 @@ class SocketOption(message.Message, metaclass=MessageMeta): @final class SocketOptionTimeout(message.Message, metaclass=MessageMeta): + __slots__ = () DURATION_FIELD_NUMBER: ClassVar[int] duration: duration_pb2.Duration def __init__(self, duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -384,6 +407,7 @@ class SocketOptionTimeout(message.Message, metaclass=MessageMeta): @final class SocketOptionLinger(message.Message, metaclass=MessageMeta): + __slots__ = () ACTIVE_FIELD_NUMBER: ClassVar[int] DURATION_FIELD_NUMBER: ClassVar[int] active: bool @@ -395,6 +419,7 @@ class SocketOptionLinger(message.Message, metaclass=MessageMeta): @final class SocketOptionTcpInfo(message.Message, metaclass=MessageMeta): + __slots__ = () TCPI_STATE_FIELD_NUMBER: ClassVar[int] TCPI_CA_STATE_FIELD_NUMBER: ClassVar[int] TCPI_RETRANSMITS_FIELD_NUMBER: ClassVar[int] @@ -489,6 +514,7 @@ class SocketOptionTcpInfo(message.Message, metaclass=MessageMeta): @final class GetTopChannelsRequest(message.Message, metaclass=MessageMeta): + __slots__ = () START_CHANNEL_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] start_channel_id: int @@ -498,6 +524,7 @@ class GetTopChannelsRequest(message.Message, metaclass=MessageMeta): @final class GetTopChannelsResponse(message.Message, metaclass=MessageMeta): + __slots__ = () CHANNEL_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] channel: containers.RepeatedCompositeFieldContainer[Channel] @@ -507,6 +534,7 @@ class GetTopChannelsResponse(message.Message, metaclass=MessageMeta): @final class GetServersRequest(message.Message, metaclass=MessageMeta): + __slots__ = () START_SERVER_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] start_server_id: int @@ -516,6 +544,7 @@ class GetServersRequest(message.Message, metaclass=MessageMeta): @final class GetServersResponse(message.Message, metaclass=MessageMeta): + __slots__ = () SERVER_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] server: containers.RepeatedCompositeFieldContainer[Server] @@ -525,6 +554,7 @@ class GetServersResponse(message.Message, metaclass=MessageMeta): @final class GetServerRequest(message.Message, metaclass=MessageMeta): + __slots__ = () SERVER_ID_FIELD_NUMBER: ClassVar[int] server_id: int def __init__(self, server_id: int | None = ...) -> None: ... @@ -532,6 +562,7 @@ class GetServerRequest(message.Message, metaclass=MessageMeta): @final class GetServerResponse(message.Message, metaclass=MessageMeta): + __slots__ = () SERVER_FIELD_NUMBER: ClassVar[int] server: Server def __init__(self, server: Server | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -539,6 +570,7 @@ class GetServerResponse(message.Message, metaclass=MessageMeta): @final class GetServerSocketsRequest(message.Message, metaclass=MessageMeta): + __slots__ = () SERVER_ID_FIELD_NUMBER: ClassVar[int] START_SOCKET_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] @@ -550,6 +582,7 @@ class GetServerSocketsRequest(message.Message, metaclass=MessageMeta): @final class GetServerSocketsResponse(message.Message, metaclass=MessageMeta): + __slots__ = () SOCKET_REF_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] @@ -561,6 +594,7 @@ class GetServerSocketsResponse(message.Message, metaclass=MessageMeta): @final class GetChannelRequest(message.Message, metaclass=MessageMeta): + __slots__ = () CHANNEL_ID_FIELD_NUMBER: ClassVar[int] channel_id: int def __init__(self, channel_id: int | None = ...) -> None: ... @@ -568,6 +602,7 @@ class GetChannelRequest(message.Message, metaclass=MessageMeta): @final class GetChannelResponse(message.Message, metaclass=MessageMeta): + __slots__ = () CHANNEL_FIELD_NUMBER: ClassVar[int] channel: Channel def __init__(self, channel: Channel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -575,6 +610,7 @@ class GetChannelResponse(message.Message, metaclass=MessageMeta): @final class GetSubchannelRequest(message.Message, metaclass=MessageMeta): + __slots__ = () SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] subchannel_id: int def __init__(self, subchannel_id: int | None = ...) -> None: ... @@ -582,6 +618,7 @@ class GetSubchannelRequest(message.Message, metaclass=MessageMeta): @final class GetSubchannelResponse(message.Message, metaclass=MessageMeta): + __slots__ = () SUBCHANNEL_FIELD_NUMBER: ClassVar[int] subchannel: Subchannel def __init__(self, subchannel: Subchannel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -589,6 +626,7 @@ class GetSubchannelResponse(message.Message, metaclass=MessageMeta): @final class GetSocketRequest(message.Message, metaclass=MessageMeta): + __slots__ = () SOCKET_ID_FIELD_NUMBER: ClassVar[int] SUMMARY_FIELD_NUMBER: ClassVar[int] socket_id: int @@ -598,6 +636,7 @@ class GetSocketRequest(message.Message, metaclass=MessageMeta): @final class GetSocketResponse(message.Message, metaclass=MessageMeta): + __slots__ = () SOCKET_FIELD_NUMBER: ClassVar[int] socket: Socket def __init__(self, socket: Socket | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... diff --git a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi index 82191f79b659..0aea338b5eb7 100644 --- a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi +++ b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi @@ -8,6 +8,7 @@ DESCRIPTOR: FileDescriptor @final class HealthCheckRequest(message.Message, metaclass=MessageMeta): + __slots__ = () SERVICE_FIELD_NUMBER: ClassVar[int] service: str def __init__(self, service: str | None = ...) -> None: ... @@ -15,6 +16,7 @@ class HealthCheckRequest(message.Message, metaclass=MessageMeta): @final class HealthCheckResponse(message.Message, metaclass=MessageMeta): + __slots__ = () ServingStatus: Incomplete UNKNOWN: Incomplete SERVING: Incomplete diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi index 94f335771385..946222b61c55 100644 --- a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi @@ -10,6 +10,7 @@ DESCRIPTOR: FileDescriptor @final class ServerReflectionRequest(message.Message, metaclass=MessageMeta): + __slots__ = () HOST_FIELD_NUMBER: ClassVar[int] FILE_BY_FILENAME_FIELD_NUMBER: ClassVar[int] FILE_CONTAINING_SYMBOL_FIELD_NUMBER: ClassVar[int] @@ -35,6 +36,7 @@ class ServerReflectionRequest(message.Message, metaclass=MessageMeta): @final class ExtensionRequest(message.Message, metaclass=MessageMeta): + __slots__ = () CONTAINING_TYPE_FIELD_NUMBER: ClassVar[int] EXTENSION_NUMBER_FIELD_NUMBER: ClassVar[int] containing_type: str @@ -44,6 +46,7 @@ class ExtensionRequest(message.Message, metaclass=MessageMeta): @final class ServerReflectionResponse(message.Message, metaclass=MessageMeta): + __slots__ = () VALID_HOST_FIELD_NUMBER: ClassVar[int] ORIGINAL_REQUEST_FIELD_NUMBER: ClassVar[int] FILE_DESCRIPTOR_RESPONSE_FIELD_NUMBER: ClassVar[int] @@ -69,6 +72,7 @@ class ServerReflectionResponse(message.Message, metaclass=MessageMeta): @final class FileDescriptorResponse(message.Message, metaclass=MessageMeta): + __slots__ = () FILE_DESCRIPTOR_PROTO_FIELD_NUMBER: ClassVar[int] file_descriptor_proto: containers.RepeatedScalarFieldContainer[bytes] def __init__(self, file_descriptor_proto: Iterable[bytes] | None = ...) -> None: ... @@ -76,6 +80,7 @@ class FileDescriptorResponse(message.Message, metaclass=MessageMeta): @final class ExtensionNumberResponse(message.Message, metaclass=MessageMeta): + __slots__ = () BASE_TYPE_NAME_FIELD_NUMBER: ClassVar[int] EXTENSION_NUMBER_FIELD_NUMBER: ClassVar[int] base_type_name: str @@ -85,6 +90,7 @@ class ExtensionNumberResponse(message.Message, metaclass=MessageMeta): @final class ListServiceResponse(message.Message, metaclass=MessageMeta): + __slots__ = () SERVICE_FIELD_NUMBER: ClassVar[int] service: containers.RepeatedCompositeFieldContainer[ServiceResponse] def __init__(self, service: Iterable[ServiceResponse | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... @@ -92,6 +98,7 @@ class ListServiceResponse(message.Message, metaclass=MessageMeta): @final class ServiceResponse(message.Message, metaclass=MessageMeta): + __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] name: str def __init__(self, name: str | None = ...) -> None: ... @@ -99,6 +106,7 @@ class ServiceResponse(message.Message, metaclass=MessageMeta): @final class ErrorResponse(message.Message, metaclass=MessageMeta): + __slots__ = () ERROR_CODE_FIELD_NUMBER: ClassVar[int] ERROR_MESSAGE_FIELD_NUMBER: ClassVar[int] error_code: int diff --git a/stubs/jsonschema/jsonschema/_types.pyi b/stubs/jsonschema/jsonschema/_types.pyi index c6d96377052c..a4fa843f195c 100644 --- a/stubs/jsonschema/jsonschema/_types.pyi +++ b/stubs/jsonschema/jsonschema/_types.pyi @@ -12,6 +12,7 @@ def is_string(checker: Unused, instance: object) -> bool: ... def is_any(checker: Unused, instance: Unused) -> Literal[True]: ... class TypeChecker: + __slots__ = ("_type_checkers", "__weakref__") def __init__(self, type_checkers: Mapping[str, Callable[[object], bool]] = ...) -> None: ... def is_type(self, instance, type: str) -> bool: ... def redefine(self, type: str, fn: Callable[..., bool]) -> TypeChecker: ... diff --git a/stubs/jsonschema/jsonschema/cli.pyi b/stubs/jsonschema/jsonschema/cli.pyi index 0358db4e5979..3d640e236fb6 100644 --- a/stubs/jsonschema/jsonschema/cli.pyi +++ b/stubs/jsonschema/jsonschema/cli.pyi @@ -9,6 +9,7 @@ class _CannotLoadFile(Exception): ... @deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") class _Outputter: + __slots__ = ("_formatter", "_stdout", "_stderr", "__weakref__") _formatter: _PlainFormatter | _PrettyFormatter _stdout: SupportsWrite[str] _stderr: SupportsWrite[str] @@ -28,6 +29,7 @@ class _Outputter: @deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") class _PrettyFormatter: + __slots__ = ("__weakref__",) _ERROR_MSG: str _SUCCESS_MSG: str @@ -39,6 +41,7 @@ class _PrettyFormatter: @deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") class _PlainFormatter: + __slots__ = ("_error_format", "__weakref__") _error_format: str def __init__(self, error_format: str) -> None: ... diff --git a/stubs/jsonschema/jsonschema/validators.pyi b/stubs/jsonschema/jsonschema/validators.pyi index 602c21c8eda8..4e93434f1d65 100644 --- a/stubs/jsonschema/jsonschema/validators.pyi +++ b/stubs/jsonschema/jsonschema/validators.pyi @@ -76,12 +76,23 @@ def create( def extend(validator, validators=(), version=None, type_checker=None, format_checker=None): ... # At runtime these are fields that are assigned the return values of create() calls. -class Draft3Validator(_Validator): ... -class Draft4Validator(_Validator): ... -class Draft6Validator(_Validator): ... -class Draft7Validator(_Validator): ... -class Draft201909Validator(_Validator): ... -class Draft202012Validator(_Validator): ... +class Draft3Validator(_Validator): + __slots__ = ("_validators", "schema", "_ref_resolver", "format_checker", "_registry", "_resolver", "__weakref__") + +class Draft4Validator(_Validator): + __slots__ = ("_validators", "schema", "_ref_resolver", "format_checker", "_registry", "_resolver", "__weakref__") + +class Draft6Validator(_Validator): + __slots__ = ("_validators", "schema", "_ref_resolver", "format_checker", "_registry", "_resolver", "__weakref__") + +class Draft7Validator(_Validator): + __slots__ = ("_validators", "schema", "_ref_resolver", "format_checker", "_registry", "_resolver", "__weakref__") + +class Draft201909Validator(_Validator): + __slots__ = ("_validators", "schema", "_ref_resolver", "format_checker", "_registry", "_resolver", "__weakref__") + +class Draft202012Validator(_Validator): + __slots__ = ("_validators", "schema", "_ref_resolver", "format_checker", "_registry", "_resolver", "__weakref__") _Handler: TypeAlias = Callable[[str], Incomplete] diff --git a/stubs/netaddr/netaddr/eui/__init__.pyi b/stubs/netaddr/netaddr/eui/__init__.pyi index 38a5e3fd5d29..c73a5b6e34d8 100644 --- a/stubs/netaddr/netaddr/eui/__init__.pyi +++ b/stubs/netaddr/netaddr/eui/__init__.pyi @@ -8,11 +8,13 @@ from netaddr.strategy.eui48 import mac_eui48 from netaddr.strategy.eui64 import eui64_base class BaseIdentifier: + __slots__ = ("_value", "__weakref__") def __init__(self) -> None: ... def __int__(self) -> int: ... def __index__(self) -> int: ... class OUI(BaseIdentifier): + __slots__ = ("records",) records: list[dict[str, object]] def __init__(self, oui: str | int) -> None: ... def __eq__(self, other: object) -> bool: ... @@ -22,6 +24,7 @@ class OUI(BaseIdentifier): def registration(self, index: int = 0) -> DictDotLookup: ... class IAB(BaseIdentifier): + __slots__ = ("record",) IAB_EUI_VALUES: ClassVar[tuple[int, int]] @classmethod def split_iab_mac(cls, eui_int: int, strict: bool = False) -> tuple[int, int]: ... @@ -32,6 +35,7 @@ class IAB(BaseIdentifier): def registration(self) -> DictDotLookup: ... class EUI(BaseIdentifier): + __slots__ = ("_module", "_dialect") def __init__( self, addr: EUI | int | str, version: int | None = None, dialect: type[mac_eui48 | eui64_base] | None = None ) -> None: ... diff --git a/stubs/netaddr/netaddr/ip/__init__.pyi b/stubs/netaddr/netaddr/ip/__init__.pyi index de1e752cbc2a..b857e10436ad 100644 --- a/stubs/netaddr/netaddr/ip/__init__.pyi +++ b/stubs/netaddr/netaddr/ip/__init__.pyi @@ -8,6 +8,7 @@ from netaddr.core import DictDotLookup from netaddr.strategy.ipv6 import ipv6_verbose class BaseIP: + __slots__ = ("_value", "_module", "__weakref__") def __init__(self) -> None: ... @property def value(self) -> int | None: ... @@ -40,6 +41,7 @@ _IPAddressAddr: TypeAlias = BaseIP | int | str _IPNetworkAddr: TypeAlias = IPNetwork | IPAddress | tuple[int, int] | str class IPAddress(BaseIP): + __slots__ = () def __init__(self, addr: _IPAddressAddr, version: Literal[4, 6] | None = None, flags: int = 0) -> None: ... def netmask_bits(self) -> int: ... def is_hostmask(self) -> bool: ... @@ -79,6 +81,7 @@ class IPAddress(BaseIP): def is_ipv6_unique_local(self) -> bool: ... class IPListMixin: + __slots__ = () def __iter__(self) -> Iterator[IPAddress]: ... @property def size(self) -> int: ... @@ -95,6 +98,7 @@ class IPListMixin: def parse_ip_network(module, addr: tuple[int, int] | str, flags: int = 0, *, expand_partial: bool = False) -> tuple[int, int]: ... class IPNetwork(BaseIP, IPListMixin): + __slots__ = ("_prefixlen",) def __init__( self, addr: _IPNetworkAddr, version: Literal[4, 6] | None = None, flags: int = 0, *, expand_partial: bool = False ) -> None: ... @@ -135,6 +139,7 @@ class IPNetwork(BaseIP, IPListMixin): def iter_hosts(self) -> Iterator[IPAddress]: ... class IPRange(BaseIP, IPListMixin): + __slots__ = ("_start", "_end") def __init__(self, start: _IPAddressAddr, end: _IPAddressAddr, flags: int = 0) -> None: ... def __contains__(self, other: BaseIP | _IPAddressAddr) -> bool: ... @property diff --git a/stubs/netaddr/netaddr/ip/glob.pyi b/stubs/netaddr/netaddr/ip/glob.pyi index 34660723c002..e0836fcf3bdd 100644 --- a/stubs/netaddr/netaddr/ip/glob.pyi +++ b/stubs/netaddr/netaddr/ip/glob.pyi @@ -10,6 +10,7 @@ def glob_to_cidrs(ipglob: str) -> list[IPNetwork]: ... def cidr_to_glob(cidr: _IPNetworkAddr) -> str: ... class IPGlob(IPRange): + __slots__ = ("_glob",) def __init__(self, ipglob: str) -> None: ... @property def glob(self) -> str: ... diff --git a/stubs/netaddr/netaddr/ip/sets.pyi b/stubs/netaddr/netaddr/ip/sets.pyi index 49f9cf64dd57..b512ee720b30 100644 --- a/stubs/netaddr/netaddr/ip/sets.pyi +++ b/stubs/netaddr/netaddr/ip/sets.pyi @@ -7,6 +7,7 @@ from netaddr.ip import IPAddress, IPNetwork, IPRange, _IPNetworkAddr _IPIterable: TypeAlias = IPNetwork | IPRange | IPSet | Iterable[_IPNetworkAddr | IPRange | int] class IPSet: + __slots__ = ("_cidrs", "__weakref__") def __init__(self, iterable: _IPIterable | None = None, flags: int = 0) -> None: ... def compact(self) -> None: ... def __hash__(self) -> NoReturn: ... diff --git a/stubs/networkx/networkx/algorithms/flow/utils.pyi b/stubs/networkx/networkx/algorithms/flow/utils.pyi index cd5bdaf4bfa2..a935bc29b572 100644 --- a/stubs/networkx/networkx/algorithms/flow/utils.pyi +++ b/stubs/networkx/networkx/algorithms/flow/utils.pyi @@ -5,11 +5,13 @@ from networkx.utils.backends import _dispatchable __all__ = ["CurrentEdge", "Level", "GlobalRelabelThreshold", "build_residual_network", "detect_unboundedness", "build_flow_dict"] class CurrentEdge: + __slots__ = ("_edges", "_it", "_curr") def __init__(self, edges) -> None: ... def get(self): ... def move_to_next(self) -> None: ... class Level: + __slots__ = ("active", "inactive") active: Incomplete inactive: Incomplete diff --git a/stubs/networkx/networkx/algorithms/planarity.pyi b/stubs/networkx/networkx/algorithms/planarity.pyi index f8f0f621ff89..8fbb3f260c57 100644 --- a/stubs/networkx/networkx/algorithms/planarity.pyi +++ b/stubs/networkx/networkx/algorithms/planarity.pyi @@ -34,6 +34,26 @@ class ConflictPair: def lowest(self, planarity_state): ... class LRPlanarity: + __slots__ = [ + "G", + "roots", + "height", + "lowpt", + "lowpt2", + "nesting_depth", + "parent_edge", + "DG", + "adjs", + "ordered_adjs", + "ref", + "side", + "S", + "stack_bottom", + "lowpt_edge", + "left_ref", + "right_ref", + "embedding", + ] G: Incomplete roots: Incomplete height: Incomplete diff --git a/stubs/networkx/networkx/classes/coreviews.pyi b/stubs/networkx/networkx/classes/coreviews.pyi index 286c7db65c4d..ed0114551bfc 100644 --- a/stubs/networkx/networkx/classes/coreviews.pyi +++ b/stubs/networkx/networkx/classes/coreviews.pyi @@ -21,6 +21,7 @@ __all__ = [ ] class AtlasView(Mapping[_T, dict[_U, _V]]): + __slots__ = ("_atlas",) def __getstate__(self) -> dict[str, Mapping[_T, dict[_U, _V]]]: ... def __setstate__(self, state: dict[str, Mapping[_T, dict[_U, _V]]]) -> None: ... def __init__(self, d: Mapping[_T, dict[_U, _V]]) -> None: ... @@ -29,10 +30,14 @@ class AtlasView(Mapping[_T, dict[_U, _V]]): def __getitem__(self, key: _T) -> dict[_U, _V]: ... def copy(self) -> dict[_T, dict[_U, _V]]: ... -class AdjacencyView(AtlasView[_T, _U, _V]): ... -class MultiAdjacencyView(AdjacencyView[_T, _U, _V]): ... +class AdjacencyView(AtlasView[_T, _U, _V]): + __slots__ = () + +class MultiAdjacencyView(AdjacencyView[_T, _U, _V]): + __slots__ = () class UnionAtlas(Mapping[_T, dict[_U, _V]]): + __slots__ = ("_succ", "_pred") def __init__(self, succ: AtlasView[_T, _U, _V], pred: AtlasView[_T, _U, _V]) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... @@ -40,14 +45,18 @@ class UnionAtlas(Mapping[_T, dict[_U, _V]]): def copy(self) -> Self: ... class UnionAdjacency(Mapping[_T, dict[_U, _V]]): + __slots__ = ("_succ", "_pred") def __init__(self, succ: AdjacencyView[_T, _U, _V], pred: AdjacencyView[_T, _U, _V]) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... def __getitem__(self, key: _T) -> dict[_U, _V]: ... def copy(self) -> Self: ... -class UnionMultiInner(UnionAtlas[_T, _U, _V]): ... -class UnionMultiAdjacency(UnionAdjacency[_T, _U, _V]): ... +class UnionMultiInner(UnionAtlas[_T, _U, _V]): + __slots__ = () + +class UnionMultiAdjacency(UnionAdjacency[_T, _U, _V]): + __slots__ = () class FilterAtlas(Mapping[_T, _U]): NODE_OK: Callable[[_T], bool] diff --git a/stubs/networkx/networkx/classes/reportviews.pyi b/stubs/networkx/networkx/classes/reportviews.pyi index 0f5b8655b190..dc9175291af4 100644 --- a/stubs/networkx/networkx/classes/reportviews.pyi +++ b/stubs/networkx/networkx/classes/reportviews.pyi @@ -35,6 +35,7 @@ __all__ = [ ] class NodeView(Mapping[_Node, dict[str, Any]], AbstractSet[_Node]): + __slots__ = ("_nodes",) def __init__(self, graph: Graph[_Node]) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_Node]: ... @@ -47,6 +48,7 @@ class NodeView(Mapping[_Node, dict[str, Any]], AbstractSet[_Node]): def data(self, data: bool | str = True, default=None) -> Self: ... class NodeDataView(AbstractSet[_Node]): + __slots__ = ("_nodes", "_data", "_default") def __init__(self, nodedict: Mapping[str, Incomplete], data: bool | str = False, default=None) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[tuple[_Node, Incomplete]]: ... # type: ignore[override] @@ -73,24 +75,33 @@ class OutMultiDegreeView(DiDegreeView[_Node]): ... class EdgeViewABC(ABC): ... class OutEdgeDataView(EdgeViewABC, Generic[_Node, _D]): + __slots__ = ("_viewer", "_nbunch", "_data", "_default", "_adjdict", "_nodes_nbrs", "_report") def __init__(self, viewer, nbunch: _NBunch[_Node] = None, data: bool = False, *, default=None) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_D]: ... def __contains__(self, e: _Edge[_Node]) -> bool: ... -class EdgeDataView(OutEdgeDataView[_Node, _D]): ... -class InEdgeDataView(OutEdgeDataView[_Node, _D]): ... +class EdgeDataView(OutEdgeDataView[_Node, _D]): + __slots__ = () + +class InEdgeDataView(OutEdgeDataView[_Node, _D]): + __slots__ = () class OutMultiEdgeDataView(OutEdgeDataView[_Node, _D]): + __slots__ = ("keys",) keys: bool def __init__( self, viewer, nbunch: _NBunch[_Node] = None, data: bool = False, *, default=None, keys: bool = False ) -> None: ... -class MultiEdgeDataView(OutEdgeDataView[_Node, _D]): ... -class InMultiEdgeDataView(OutEdgeDataView[_Node, _D]): ... +class MultiEdgeDataView(OutEdgeDataView[_Node, _D]): + __slots__ = () + +class InMultiEdgeDataView(OutEdgeDataView[_Node, _D]): + __slots__ = () class OutEdgeView(AbstractSet[Incomplete], Mapping[Incomplete, Incomplete], EdgeViewABC, Generic[_Node]): + __slots__ = ("_adjdict", "_graph", "_nodes_nbrs") def __init__(self, G: Graph[_Node]) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[tuple[_Node, _Node]]: ... @@ -131,6 +142,7 @@ class OutEdgeView(AbstractSet[Incomplete], Mapping[Incomplete, Incomplete], Edge ) -> OutEdgeDataView[_Node, tuple[_Node, _Node, _U]]: ... class EdgeView(OutEdgeView[_Node]): + __slots__ = () dataview = EdgeDataView # Have to override parent's overloads with the proper return type based on dataview @overload @@ -167,6 +179,7 @@ class EdgeView(OutEdgeView[_Node]): ) -> EdgeDataView[_Node, tuple[_Node, _Node, _U]]: ... class InEdgeView(OutEdgeView[_Node]): + __slots__ = () dataview = InEdgeDataView # Have to override parent's overloads with the proper return type based on dataview @overload @@ -203,6 +216,7 @@ class InEdgeView(OutEdgeView[_Node]): ) -> InEdgeDataView[_Node, tuple[_Node, _Node, _U]]: ... class OutMultiEdgeView(OutEdgeView[_Node]): + __slots__ = () def __iter__(self) -> Iterator[tuple[_Node, _Node, Incomplete]]: ... # type: ignore[override] def __getitem__(self, e: tuple[_Node, _Node, Incomplete]) -> dict[str, Any]: ... # type: ignore[override] dataview = OutMultiEdgeDataView @@ -266,6 +280,7 @@ class OutMultiEdgeView(OutEdgeView[_Node]): ) -> OutMultiEdgeDataView[_Node, tuple[_Node, _Node, Incomplete, _U]]: ... class MultiEdgeView(OutMultiEdgeView[_Node]): + __slots__ = () dataview = MultiEdgeDataView # type: ignore[assignment] # Have to override parent's overloads with the proper return type based on dataview @overload # type: ignore[override] # Has an additional `keys` keyword argument @@ -328,6 +343,7 @@ class MultiEdgeView(OutMultiEdgeView[_Node]): ) -> MultiEdgeDataView[_Node, tuple[_Node, _Node, Incomplete, _U]]: ... class InMultiEdgeView(OutMultiEdgeView[_Node]): + __slots__ = () dataview = InMultiEdgeDataView # type: ignore[assignment] # Have to override parent's overloads with the proper return type based on dataview @overload # type: ignore[override] diff --git a/stubs/networkx/networkx/utils/configs.pyi b/stubs/networkx/networkx/utils/configs.pyi index 780ccf7233a2..255beb56366d 100644 --- a/stubs/networkx/networkx/utils/configs.pyi +++ b/stubs/networkx/networkx/utils/configs.pyi @@ -12,6 +12,7 @@ __all__ = ["Config"] if sys.version_info >= (3, 10): @dataclass(init=False, eq=False, slots=True, kw_only=True, match_args=False) class Config: + __slots__ = () def __init_subclass__(cls, strict: bool = True) -> None: ... def __new__(cls, **kwargs) -> Self: ... def __dir__(self) -> Iterable[str]: ... diff --git a/stubs/networkx/networkx/utils/heaps.pyi b/stubs/networkx/networkx/utils/heaps.pyi index 92b3832cfa4e..f03e301f9e4b 100644 --- a/stubs/networkx/networkx/utils/heaps.pyi +++ b/stubs/networkx/networkx/utils/heaps.pyi @@ -4,6 +4,7 @@ __all__ = ["MinHeap", "PairingHeap", "BinaryHeap"] class MinHeap: class _Item: + __slots__ = ("key", "value") key: Incomplete value: Incomplete def __init__(self, key, value) -> None: ... @@ -20,6 +21,7 @@ class MinHeap: class PairingHeap(MinHeap): class _Node(MinHeap._Item): + __slots__ = ("left", "next", "prev", "parent") left: Incomplete next: Incomplete prev: Incomplete diff --git a/stubs/networkx/networkx/utils/mapped_queue.pyi b/stubs/networkx/networkx/utils/mapped_queue.pyi index 86e8c0e0ecde..38710ddb601f 100644 --- a/stubs/networkx/networkx/utils/mapped_queue.pyi +++ b/stubs/networkx/networkx/utils/mapped_queue.pyi @@ -4,6 +4,7 @@ from collections.abc import Iterator __all__ = ["MappedQueue"] class _HeapElement: + __slots__ = ["priority", "element", "_hash"] priority: Incomplete element: Incomplete def __init__(self, priority, element) -> None: ... diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi index a0cdc5bdfcf8..d55acfe0f56f 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi @@ -46,11 +46,13 @@ def signed_token_generator(private_pem: str, **kwargs) -> Callable[[Request], st def get_token_from_header(request: Request) -> str | None: ... class TokenBase: + __slots__ = () def __call__(self, request: Request, refresh_token: bool = False) -> None: ... def validate_request(self, request: Request) -> bool: ... def estimate_type(self, request: Request) -> int: ... class BearerToken(TokenBase): + __slots__ = ("request_validator", "token_generator", "refresh_token_generator", "expires_in") request_validator: RequestValidator | None token_generator: Callable[[Request], str] refresh_token_generator: Callable[[Request], str] diff --git a/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi b/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi index 081db3dec53a..39c52b1d0753 100644 --- a/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi +++ b/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi @@ -6,6 +6,7 @@ from oauthlib.oauth2.rfc6749.tokens import TokenBase as TokenBase from .request_validator import RequestValidator class JWTToken(TokenBase): + __slots__ = ("request_validator", "token_generator", "refresh_token_generator", "expires_in") request_validator: RequestValidator token_generator: Callable[[Request], str] | Callable[[Request, bool], str] refresh_token_generator: Callable[[Request], str] | Callable[[Request, bool], str] diff --git a/stubs/openpyxl/openpyxl/cell/cell.pyi b/stubs/openpyxl/openpyxl/cell/cell.pyi index fb5cbb54545c..2b75f5a281fa 100644 --- a/stubs/openpyxl/openpyxl/cell/cell.pyi +++ b/stubs/openpyxl/openpyxl/cell/cell.pyi @@ -36,6 +36,7 @@ def get_type(t: type, value: object) -> Literal["n", "s", "d", "f"] | None: ... def get_time_format(t: _TimeTypes) -> str: ... class Cell(StyleableObject): + __slots__ = ("row", "column", "_value", "data_type", "parent", "_hyperlink", "_comment") row: int column: int data_type: str @@ -82,6 +83,7 @@ class Cell(StyleableObject): def comment(self, value: Comment | None) -> None: ... class MergedCell(StyleableObject): + __slots__ = ("row", "column") data_type: str comment: Comment | None hyperlink: Hyperlink | None diff --git a/stubs/openpyxl/openpyxl/cell/read_only.pyi b/stubs/openpyxl/openpyxl/cell/read_only.pyi index b8dd7cf3226e..5635de13ee80 100644 --- a/stubs/openpyxl/openpyxl/cell/read_only.pyi +++ b/stubs/openpyxl/openpyxl/cell/read_only.pyi @@ -12,6 +12,7 @@ from openpyxl.workbook.child import _WorkbookChild from openpyxl.worksheet._read_only import ReadOnlyWorksheet class ReadOnlyCell: + __slots__ = ("parent", "row", "column", "_value", "data_type", "_style_id") parent: _WorkbookChild | ReadOnlyWorksheet row: Incomplete column: Incomplete @@ -58,6 +59,7 @@ class ReadOnlyCell: def value(self, value: None) -> None: ... class EmptyCell: + __slots__ = () value: Incomplete is_date: bool font: Incomplete diff --git a/stubs/openpyxl/openpyxl/formula/tokenizer.pyi b/stubs/openpyxl/openpyxl/formula/tokenizer.pyi index 2aafed4d0357..f37992ae87a6 100644 --- a/stubs/openpyxl/openpyxl/formula/tokenizer.pyi +++ b/stubs/openpyxl/openpyxl/formula/tokenizer.pyi @@ -30,6 +30,7 @@ class Tokenizer: def render(self): ... class Token: + __slots__ = ["value", "type", "subtype"] LITERAL: Final = "LITERAL" OPERAND: Final = "OPERAND" FUNC: Final = "FUNC" diff --git a/stubs/openpyxl/openpyxl/styles/cell_style.pyi b/stubs/openpyxl/openpyxl/styles/cell_style.pyi index c1867a7b356f..6852b377d20b 100644 --- a/stubs/openpyxl/openpyxl/styles/cell_style.pyi +++ b/stubs/openpyxl/openpyxl/styles/cell_style.pyi @@ -19,6 +19,7 @@ class ArrayDescriptor(Generic[_T]): def __set__(self, instance: MutableSequence[_T], value: _T) -> None: ... class StyleArray(array[int]): + __slots__ = () tagname: ClassVar[str] fontId: ArrayDescriptor[int] fillId: ArrayDescriptor[int] diff --git a/stubs/openpyxl/openpyxl/styles/proxy.pyi b/stubs/openpyxl/openpyxl/styles/proxy.pyi index 2b458bd5c204..1fd18127d71e 100644 --- a/stubs/openpyxl/openpyxl/styles/proxy.pyi +++ b/stubs/openpyxl/openpyxl/styles/proxy.pyi @@ -1,6 +1,7 @@ from typing_extensions import deprecated class StyleProxy: + __slots__ = "__target" def __init__(self, target) -> None: ... def __getattr__(self, attr: str): ... def __setattr__(self, attr: str, value) -> None: ... diff --git a/stubs/openpyxl/openpyxl/styles/styleable.pyi b/stubs/openpyxl/openpyxl/styles/styleable.pyi index 07744bd3ecdb..1601d769d14b 100644 --- a/stubs/openpyxl/openpyxl/styles/styleable.pyi +++ b/stubs/openpyxl/openpyxl/styles/styleable.pyi @@ -34,6 +34,7 @@ class StyleArrayDescriptor: def __get__(self, instance: StyleableObject, cls: Unused) -> bool: ... class StyleableObject: + __slots__ = ("parent", "_style") font: StyleDescriptor fill: StyleDescriptor border: StyleDescriptor diff --git a/stubs/paramiko/paramiko/transport.pyi b/stubs/paramiko/paramiko/transport.pyi index eacc0b4fa25e..6b2f2df1c279 100644 --- a/stubs/paramiko/paramiko/transport.pyi +++ b/stubs/paramiko/paramiko/transport.pyi @@ -175,6 +175,7 @@ class Transport(Thread, ClosingContextManager): def run(self) -> None: ... class SecurityOptions: + __slots__ = "_transport" def __init__(self, transport: Transport) -> None: ... @property def ciphers(self) -> Sequence[str]: ... diff --git a/stubs/parsimonious/parsimonious/expressions.pyi b/stubs/parsimonious/parsimonious/expressions.pyi index a5445dd24e3c..fcc6965fa442 100644 --- a/stubs/parsimonious/parsimonious/expressions.pyi +++ b/stubs/parsimonious/parsimonious/expressions.pyi @@ -21,6 +21,7 @@ def expression(callable: _CALLABLE_TYPE, rule_name: str, grammar: Grammar) -> Ex IN_PROGRESS: object class Expression(StrAndRepr): + __slots__ = ["name", "identity_tuple"] name: str identity_tuple: tuple[str] def __init__(self, name: str = "") -> None: ... @@ -31,6 +32,7 @@ class Expression(StrAndRepr): def as_rule(self) -> str: ... class Literal(Expression): + __slots__ = ["literal"] literal: str identity_tuple: tuple[str, str] # type: ignore[assignment] def __init__(self, literal: str, name: str = "") -> None: ... @@ -38,6 +40,7 @@ class Literal(Expression): class TokenMatcher(Literal): ... class Regex(Expression): + __slots__ = ["re"] re: Pattern[str] identity_tuple: tuple[str, Pattern[str]] # type: ignore[assignment] def __init__( @@ -54,6 +57,7 @@ class Regex(Expression): ) -> None: ... class Compound(Expression): + __slots__ = ["members"] members: collections.abc.Sequence[Expression] def __init__(self, *members: Expression, **kwargs: Any) -> None: ... @@ -61,12 +65,14 @@ class Sequence(Compound): ... class OneOf(Compound): ... class Lookahead(Compound): + __slots__ = ["negativity"] negativity: bool def __init__(self, member: Expression, *, negative: bool = False, **kwargs: Any) -> None: ... def Not(term: Expression) -> Lookahead: ... class Quantifier(Compound): + __slots__ = ["min", "max"] min: int max: float def __init__(self, member: Expression, *, min: int = 0, max: float = ..., name: str = "", **kwargs: Any) -> None: ... diff --git a/stubs/parsimonious/parsimonious/nodes.pyi b/stubs/parsimonious/parsimonious/nodes.pyi index 1f6b45cb987c..1d67f2f2fd0c 100644 --- a/stubs/parsimonious/parsimonious/nodes.pyi +++ b/stubs/parsimonious/parsimonious/nodes.pyi @@ -8,6 +8,7 @@ from parsimonious.expressions import Expression from parsimonious.grammar import Grammar class Node: + __slots__ = ["expr", "full_text", "start", "end", "children"] expr: Expression full_text: str start: int @@ -25,6 +26,7 @@ class Node: def __repr__(self, top_level: bool = True) -> str: ... class RegexNode(Node): + __slots__ = ["match"] match: Match[str] class RuleDecoratorMeta(type): ... diff --git a/stubs/parsimonious/parsimonious/utils.pyi b/stubs/parsimonious/parsimonious/utils.pyi index eea5d11851d9..b9440d08abca 100644 --- a/stubs/parsimonious/parsimonious/utils.pyi +++ b/stubs/parsimonious/parsimonious/utils.pyi @@ -6,5 +6,6 @@ class StrAndRepr: ... def evaluate_string(string: str | ast.AST) -> Any: ... class Token(StrAndRepr): + __slots__ = ["type"] type: str def __init__(self, type: str) -> None: ... diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index 41a5dc3af5a7..4dece0843e82 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -13,6 +13,7 @@ from ..spec import BasicProperties LOGGER: Logger class _CallbackResult: + __slots__ = ("_value_class", "_ready", "_values") def __init__(self, value_class=None) -> None: ... def reset(self) -> None: ... def __bool__(self) -> bool: ... @@ -37,11 +38,13 @@ class _IoloopTimerContext: def is_ready(self): ... class _TimerEvt: + __slots__ = ("timer_id", "_callback") timer_id: Incomplete def __init__(self, callback) -> None: ... def dispatch(self) -> None: ... class _ConnectionBlockedUnblockedEvtBase: + __slots__ = ("_callback", "_method_frame") def __init__(self, callback, method_frame) -> None: ... def dispatch(self) -> None: ... @@ -91,18 +94,21 @@ class BlockingConnection: class _ChannelPendingEvt: ... class _ConsumerDeliveryEvt(_ChannelPendingEvt): + __slots__ = ("method", "properties", "body") method: Incomplete properties: Incomplete body: Incomplete def __init__(self, method, properties, body) -> None: ... class _ConsumerCancellationEvt(_ChannelPendingEvt): + __slots__ = ("method_frame",) method_frame: Incomplete def __init__(self, method_frame) -> None: ... @property def method(self): ... class _ReturnedMessageEvt(_ChannelPendingEvt): + __slots__ = ("callback", "channel", "method", "properties", "body") callback: Incomplete channel: Incomplete method: Incomplete @@ -112,12 +118,14 @@ class _ReturnedMessageEvt(_ChannelPendingEvt): def dispatch(self) -> None: ... class ReturnedMessage: + __slots__ = ("method", "properties", "body") method: Incomplete properties: Incomplete body: Incomplete def __init__(self, method, properties, body) -> None: ... class _ConsumerInfo: + __slots__ = ("consumer_tag", "auto_ack", "on_message_callback", "alternate_event_sink", "state") SETTING_UP: int ACTIVE: int TEARING_DOWN: int @@ -138,6 +146,7 @@ class _ConsumerInfo: def cancelled_by_broker(self): ... class _QueueConsumerGeneratorInfo: + __slots__ = ("params", "consumer_tag", "pending_events") params: Incomplete consumer_tag: Incomplete pending_events: Incomplete diff --git a/stubs/pika/pika/adapters/gevent_connection.pyi b/stubs/pika/pika/adapters/gevent_connection.pyi index 0979dbfcdd16..8491b6191c8d 100644 --- a/stubs/pika/pika/adapters/gevent_connection.pyi +++ b/stubs/pika/pika/adapters/gevent_connection.pyi @@ -52,6 +52,7 @@ class _GeventIOLoopIOHandle(AbstractIOReference): def cancel(self): ... class _GeventAddressResolver: + __slots__ = ("_loop", "_on_done", "_greenlet", "_ga_host", "_ga_port", "_ga_family", "_ga_socktype", "_ga_proto", "_ga_flags") def __init__(self, native_loop, host, port, family, socktype, proto, flags, on_done) -> None: ... def start(self) -> None: ... def cancel(self): ... diff --git a/stubs/pika/pika/adapters/select_connection.pyi b/stubs/pika/pika/adapters/select_connection.pyi index 4eed5e1f351e..8b3309410e20 100644 --- a/stubs/pika/pika/adapters/select_connection.pyi +++ b/stubs/pika/pika/adapters/select_connection.pyi @@ -23,6 +23,7 @@ class SelectConnection(BaseConnection): def create_connection(cls, connection_configs, on_done, custom_ioloop=None, workflow=None): ... class _Timeout: + __slots__ = ("deadline", "callback") deadline: Incomplete callback: Incomplete def __init__(self, deadline, callback) -> None: ... diff --git a/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi b/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi index 91dd227fa3ed..17f1305f95fc 100644 --- a/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi +++ b/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi @@ -55,6 +55,7 @@ class SelectorIOServicesAdapter( def remove_writer(self, fd): ... class _FileDescriptorCallbacks: + __slots__ = ("reader", "writer") reader: Incomplete writer: Incomplete def __init__(self, reader=None, writer=None) -> None: ... diff --git a/stubs/pika/pika/connection.pyi b/stubs/pika/pika/connection.pyi index 689bca9363fe..c8725542f6d5 100644 --- a/stubs/pika/pika/connection.pyi +++ b/stubs/pika/pika/connection.pyi @@ -17,6 +17,24 @@ PRODUCT: str LOGGER: Logger class Parameters: + __slots__ = ( + "_blocked_connection_timeout", + "_channel_max", + "_client_properties", + "_connection_attempts", + "_credentials", + "_frame_max", + "_heartbeat", + "_host", + "_locale", + "_port", + "_retry_delay", + "_socket_timeout", + "_stack_timeout", + "_ssl_options", + "_virtual_host", + "_tcp_options", + ) DEFAULT_USERNAME: str DEFAULT_PASSWORD: str DEFAULT_BLOCKED_CONNECTION_TIMEOUT: None @@ -106,6 +124,7 @@ class Parameters: def tcp_options(self, value: dict[Incomplete, Incomplete] | None) -> None: ... class ConnectionParameters(Parameters): + __slots__ = () def __init__( self, host: str = ..., @@ -127,9 +146,11 @@ class ConnectionParameters(Parameters): ) -> None: ... class URLParameters(Parameters): + __slots__ = ("_all_url_query_values",) def __init__(self, url: str) -> None: ... class SSLOptions: + __slots__ = ("context", "server_hostname") context: ssl.SSLContext server_hostname: str | None def __init__(self, context: ssl.SSLContext, server_hostname: str | None = None) -> None: ... diff --git a/stubs/pony/pony/orm/core.pyi b/stubs/pony/pony/orm/core.pyi index d158530884ea..e0510c6e1df5 100644 --- a/stubs/pony/pony/orm/core.pyi +++ b/stubs/pony/pony/orm/core.pyi @@ -245,6 +245,18 @@ def commit() -> None: ... def rollback() -> None: ... class DBSessionContextManager: + __slots__ = ( + "retry", + "retry_exceptions", + "allowed_exceptions", + "immediate", + "ddl", + "serializable", + "strict", + "optimistic", + "sql_debug", + "show_values", + ) retry: int ddl: bool serializable: bool @@ -451,6 +463,51 @@ class DescWrapper: attr_id_counter: itertools.count[int] class Attribute: + __slots__ = ( + "nullable", + "is_required", + "is_discriminator", + "is_unique", + "is_part_of_unique_index", + "is_pk", + "is_collection", + "is_relation", + "is_basic", + "is_string", + "is_volatile", + "is_implicit", + "id", + "pk_offset", + "pk_columns_offset", + "py_type", + "sql_type", + "entity", + "name", + "lazy", + "lazy_sql_cache", + "args", + "auto", + "default", + "reverse", + "composite_keys", + "column", + "columns", + "col_paths", + "_columns_checked", + "converters", + "kwargs", + "cascade_delete", + "index", + "reverse_index", + "original_default", + "sql_default", + "py_check", + "hidden", + "optimistic", + "fk_name", + "type_has_empty_value", + "interleave", + ) nullable: bool | None is_required: bool is_discriminator: bool @@ -515,12 +572,15 @@ class Attribute: def desc(attr) -> DescWrapper: ... def describe(attr) -> str: ... -class Optional(Attribute): ... +class Optional(Attribute): + __slots__ = [] class Required(Attribute): + __slots__ = [] def validate(attr, val, obj=None, entity=None, from_db: bool = False): ... class Discriminator(Required): + __slots__ = ["code2cls"] code2cls: dict[Incomplete, Incomplete] def __init__(attr, py_type, *args, **kwargs) -> None: ... @staticmethod @@ -534,6 +594,7 @@ class Discriminator(Required): def update_reverse(attr, obj, old_val, new_val, undo_funcs) -> None: ... class Index: + __slots__ = ("entity", "attrs", "is_pk", "is_unique") entity: Incomplete attrs: list[Incomplete] is_pk: bool @@ -544,9 +605,24 @@ def composite_index(*attrs) -> None: ... def composite_key(*attrs) -> None: ... class PrimaryKey(Required): + __slots__ = [] def __new__(cls, *args, **kwargs): ... class Collection(Attribute): + __slots__ = ( + "table", + "wrapper_class", + "symmetric", + "reverse_column", + "reverse_columns", + "nplus1_threshold", + "cached_load_sql", + "cached_add_m2m_sql", + "cached_remove_m2m_sql", + "cached_count_sql", + "cached_empty_sql", + "reverse_fk_name", + ) table: str | list[str] | tuple[str, ...] | None wrapper_class: Incomplete symmetric: bool @@ -568,6 +644,7 @@ class Collection(Attribute): def set(attr, obj, val, fromdb: bool = False) -> None: ... class SetData(set[Incomplete]): + __slots__ = ("is_fully_loaded", "added", "removed", "absent", "count") is_fully_loaded: bool added: Incomplete removed: Incomplete @@ -580,6 +657,7 @@ def construct_batchload_criteria_list( ): ... class Set(Collection): + __slots__ = [] def validate(attr, val, obj=None, entity=None, from_db: bool = False): ... def prefetch_load_all(attr, objects): ... def load(attr, obj, items=None): ... @@ -606,6 +684,7 @@ class SetIterator: __next__ = next class SetInstance: + __slots__ = ("_obj_", "_attr_", "_attrnames_") def __init__(wrapper, obj, attr) -> None: ... def __reduce__(wrapper): ... def copy(wrapper): ... @@ -637,6 +716,7 @@ class SetInstance: def unpickle_multiset(obj, attrnames, items): ... class Multiset: + __slots__ = ["_obj_", "_attrnames_", "_items_"] def __init__(multiset, obj, attrnames, items) -> None: ... def __reduce__(multiset): ... def distinct(multiset): ... @@ -695,6 +775,18 @@ class EntityProxy: def __ne__(self, other) -> bool: ... class Entity(metaclass=EntityMeta): + __slots__ = ( + "_session_cache_", + "_status_", + "_pkval_", + "_newid_", + "_dbvals_", + "_vals_", + "_rbits_", + "_wbits_", + "_save_pos_", + "__weakref__", + ) def __reduce__(obj): ... def __init__(obj, *args, **kwargs) -> None: ... def get_pk(obj): ... @@ -774,6 +866,7 @@ class Query: def to_json(query, include=(), exclude=(), converter=None, with_schema: bool = True, schema_hash=None): ... class QueryResultIterator: + __slots__ = ("_query_result", "_position") def __init__(self, query_result) -> None: ... def next(self): ... __next__ = next @@ -782,6 +875,7 @@ class QueryResultIterator: def make_query_result_method_error_stub(name: str, title: str | None = None) -> Callable[..., NoReturn]: ... class QueryResult: + __slots__ = ("_query", "_limit", "_offset", "_items", "_expr_type", "_col_names") def __init__(self, query, limit, offset, lazy) -> None: ... def __iter__(self): ... def __len__(self) -> int: ... diff --git a/stubs/pony/pony/orm/dbproviders/mysql.pyi b/stubs/pony/pony/orm/dbproviders/mysql.pyi index 61b2e4d9cfd3..cfc02a113ea7 100644 --- a/stubs/pony/pony/orm/dbproviders/mysql.pyi +++ b/stubs/pony/pony/orm/dbproviders/mysql.pyi @@ -20,7 +20,8 @@ class MySQLSchema(dbschema.DBSchema): class MySQLTranslator(SQLTranslator): dialect: ClassVar[str] -class MySQLValue(Value): ... +class MySQLValue(Value): + __slots__ = [] class MySQLBuilder(SQLBuilder): dialect: ClassVar[str] diff --git a/stubs/pony/pony/orm/dbproviders/sqlite.pyi b/stubs/pony/pony/orm/dbproviders/sqlite.pyi index 0bf153cd8d70..c19310227959 100644 --- a/stubs/pony/pony/orm/dbproviders/sqlite.pyi +++ b/stubs/pony/pony/orm/dbproviders/sqlite.pyi @@ -30,7 +30,8 @@ class SQLiteTranslator(SQLTranslator): StringMixin_UPPER: Incomplete StringMixin_LOWER: Incomplete -class SQLiteValue(Value): ... +class SQLiteValue(Value): + __slots__ = [] class SQLiteBuilder(SQLBuilder): dialect: ClassVar[str] diff --git a/stubs/pony/pony/orm/examples/alessandro_bug.pyi b/stubs/pony/pony/orm/examples/alessandro_bug.pyi index 07b92133e84b..f8e36522aaf7 100644 --- a/stubs/pony/pony/orm/examples/alessandro_bug.pyi +++ b/stubs/pony/pony/orm/examples/alessandro_bug.pyi @@ -6,6 +6,7 @@ from pony.orm.core import Database, Entity database: Database class User(Entity): + __slots__ = () user_id: PrimaryKey owned_pokemons: Incomplete is_admin: Incomplete @@ -20,6 +21,7 @@ class User(Entity): def set_favorite_color(self, color: tuple[Incomplete, ...]): ... class Pokemon(Entity): + __slots__ = () name: Incomplete pokemon_id: Incomplete sprite: Incomplete @@ -32,6 +34,7 @@ class Pokemon(Entity): def caught_by(self, user: User): ... class Chat(Entity): + __slots__ = () chat_id: Incomplete active: Incomplete def activate(self) -> None: ... diff --git a/stubs/pony/pony/orm/examples/compositekeys.pyi b/stubs/pony/pony/orm/examples/compositekeys.pyi index 0c747318d05e..1d48e601587f 100644 --- a/stubs/pony/pony/orm/examples/compositekeys.pyi +++ b/stubs/pony/pony/orm/examples/compositekeys.pyi @@ -5,6 +5,7 @@ from pony.orm.core import Database, Entity db: Database class Group(Entity): + __slots__ = () dept: Incomplete year: Incomplete spec: Incomplete @@ -13,6 +14,7 @@ class Group(Entity): lessons: Incomplete class Department(Entity): + __slots__ = () number: Incomplete faculty: Incomplete name: Incomplete @@ -20,23 +22,27 @@ class Department(Entity): teachers: Incomplete class Faculty(Entity): + __slots__ = () number: Incomplete name: Incomplete depts: Incomplete class Student(Entity): + __slots__ = () name: Incomplete group: Incomplete dob: Incomplete grades: Incomplete class Grade(Entity): + __slots__ = () student: Incomplete task: Incomplete date: Incomplete value: Incomplete class Task(Entity): + __slots__ = () course: Incomplete type: Incomplete number: Incomplete @@ -44,6 +50,7 @@ class Task(Entity): grades: Incomplete class Course(Entity): + __slots__ = () subject: Incomplete semester: Incomplete groups: Incomplete @@ -52,23 +59,27 @@ class Course(Entity): teachers: Incomplete class Subject(Entity): + __slots__ = () name: Incomplete descr: Incomplete courses: Incomplete class Room(Entity): + __slots__ = () building: Incomplete number: Incomplete floor: Incomplete schedules: Incomplete class Teacher(Entity): + __slots__ = () dept: Incomplete name: Incomplete courses: Incomplete lessons: Incomplete class Lesson(Entity): + __slots__ = () groups: Incomplete course: Incomplete room: Incomplete diff --git a/stubs/pony/pony/orm/examples/demo.pyi b/stubs/pony/pony/orm/examples/demo.pyi index 1d6f7ad0fb48..b2b31939bb9b 100644 --- a/stubs/pony/pony/orm/examples/demo.pyi +++ b/stubs/pony/pony/orm/examples/demo.pyi @@ -5,24 +5,28 @@ from pony.orm.core import Database, Entity db: Database class Customer(Entity): + __slots__ = () id: Incomplete name: Incomplete email: Incomplete orders: Incomplete class Order(Entity): + __slots__ = () id: Incomplete total_price: Incomplete customer: Incomplete items: Incomplete class Product(Entity): + __slots__ = () id: Incomplete name: Incomplete price: Incomplete items: Incomplete class OrderItem(Entity): + __slots__ = () quantity: Incomplete order: Incomplete product: Incomplete diff --git a/stubs/pony/pony/orm/examples/estore.pyi b/stubs/pony/pony/orm/examples/estore.pyi index 79304586c90e..8fdc234bab8d 100644 --- a/stubs/pony/pony/orm/examples/estore.pyi +++ b/stubs/pony/pony/orm/examples/estore.pyi @@ -5,6 +5,7 @@ from pony.orm.core import Database, Entity db: Database class Customer(Entity): + __slots__ = () email: Incomplete password: Incomplete name: Incomplete @@ -14,6 +15,7 @@ class Customer(Entity): orders: Incomplete class Product(Entity): + __slots__ = () id: Incomplete name: Incomplete categories: Incomplete @@ -25,17 +27,20 @@ class Product(Entity): order_items: Incomplete class CartItem(Entity): + __slots__ = () quantity: Incomplete customer: Incomplete product: Incomplete class OrderItem(Entity): + __slots__ = () quantity: Incomplete price: Incomplete order: Incomplete product: Incomplete class Order(Entity): + __slots__ = () id: Incomplete state: Incomplete date_created: Incomplete @@ -46,6 +51,7 @@ class Order(Entity): items: Incomplete class Category(Entity): + __slots__ = () name: Incomplete products: Incomplete diff --git a/stubs/pony/pony/orm/examples/inheritance1.pyi b/stubs/pony/pony/orm/examples/inheritance1.pyi index 264e39221360..24518002ee50 100644 --- a/stubs/pony/pony/orm/examples/inheritance1.pyi +++ b/stubs/pony/pony/orm/examples/inheritance1.pyi @@ -5,31 +5,38 @@ from pony.orm.core import Database, Entity db: Database class Person(Entity): + __slots__ = () id: Incomplete name: Incomplete dob: Incomplete ssn: Incomplete class Student(Person): + __slots__ = () group: Incomplete mentor: Incomplete attend_courses: Incomplete class Teacher(Person): + __slots__ = () teach_courses: Incomplete apprentices: Incomplete salary: Incomplete -class Assistant(Student, Teacher): ... +class Assistant(Student, Teacher): + __slots__ = () class Professor(Teacher): + __slots__ = () position: Incomplete class Group(Entity): + __slots__ = () number: Incomplete students: Incomplete class Course(Entity): + __slots__ = () name: Incomplete semester: Incomplete students: Incomplete diff --git a/stubs/pony/pony/orm/examples/numbers.pyi b/stubs/pony/pony/orm/examples/numbers.pyi index c28b662ead7b..ab8105fc29c9 100644 --- a/stubs/pony/pony/orm/examples/numbers.pyi +++ b/stubs/pony/pony/orm/examples/numbers.pyi @@ -5,6 +5,7 @@ from pony.orm.core import Database, Entity db: Database class Numbers(Entity): + __slots__ = () id: Incomplete int8: Incomplete int16: Incomplete diff --git a/stubs/pony/pony/orm/examples/university1.pyi b/stubs/pony/pony/orm/examples/university1.pyi index 2619428cebc1..ced29c56889d 100644 --- a/stubs/pony/pony/orm/examples/university1.pyi +++ b/stubs/pony/pony/orm/examples/university1.pyi @@ -6,18 +6,21 @@ from pony.orm.core import Database, Entity db: Database class Department(Entity): + __slots__ = () number: Incomplete name: Incomplete groups: Incomplete courses: Incomplete class Group(Entity): + __slots__ = () number: Incomplete major: Incomplete dept: Incomplete students: Incomplete class Course(Entity): + __slots__ = () name: Incomplete semester: Incomplete lect_hours: Incomplete @@ -27,6 +30,7 @@ class Course(Entity): students: Incomplete class Student(Entity): + __slots__ = () id: Incomplete name: Incomplete dob: Incomplete diff --git a/stubs/pony/pony/orm/examples/university2.pyi b/stubs/pony/pony/orm/examples/university2.pyi index 40d13737e4ab..cc5baed9e4f0 100644 --- a/stubs/pony/pony/orm/examples/university2.pyi +++ b/stubs/pony/pony/orm/examples/university2.pyi @@ -5,11 +5,13 @@ from pony.orm.core import Database, Entity db: Database class Faculty(Entity): + __slots__ = () number: Incomplete name: Incomplete departments: Incomplete class Department(Entity): + __slots__ = () number: Incomplete name: Incomplete faculty: Incomplete @@ -18,6 +20,7 @@ class Department(Entity): groups: Incomplete class Group(Entity): + __slots__ = () number: Incomplete grad_year: Incomplete department: Incomplete @@ -25,22 +28,26 @@ class Group(Entity): students: Incomplete class Student(Entity): + __slots__ = () name: Incomplete scholarship: Incomplete group: Incomplete grades: Incomplete class Major(Entity): + __slots__ = () name: Incomplete department: Incomplete courses: Incomplete class Subject(Entity): + __slots__ = () name: Incomplete courses: Incomplete teachers: Incomplete class Course(Entity): + __slots__ = () major: Incomplete subject: Incomplete semester: Incomplete @@ -51,6 +58,7 @@ class Course(Entity): grades: Incomplete class Lesson(Entity): + __slots__ = () day_of_week: Incomplete meeting_time: Incomplete classroom: Incomplete @@ -59,6 +67,7 @@ class Lesson(Entity): groups: Incomplete class Grade(Entity): + __slots__ = () student: Incomplete course: Incomplete teacher: Incomplete @@ -66,6 +75,7 @@ class Grade(Entity): value: Incomplete class Teacher(Entity): + __slots__ = () name: Incomplete degree: Incomplete department: Incomplete @@ -74,11 +84,13 @@ class Teacher(Entity): grades: Incomplete class Building(Entity): + __slots__ = () number: Incomplete description: Incomplete classrooms: Incomplete class Classroom(Entity): + __slots__ = () building: Incomplete number: Incomplete description: Incomplete diff --git a/stubs/pony/pony/orm/ormtypes.pyi b/stubs/pony/pony/orm/ormtypes.pyi index dcac43038e40..6ae9e0566dba 100644 --- a/stubs/pony/pony/orm/ormtypes.pyi +++ b/stubs/pony/pony/orm/ormtypes.pyi @@ -11,6 +11,7 @@ class LongStr(str): LongUnicode = LongStr class SetType: + __slots__ = "item_type" def __deepcopy__(self, memo) -> Self: ... item_type: Incomplete def __init__(self, item_type) -> None: ... @@ -19,6 +20,7 @@ class SetType: def __hash__(self) -> int: ... class FuncType: + __slots__ = "func" def __deepcopy__(self, memo) -> Self: ... func: Incomplete def __init__(self, func) -> None: ... @@ -27,6 +29,7 @@ class FuncType: def __hash__(self) -> int: ... class MethodType: + __slots__ = ("obj", "func") def __deepcopy__(self, memo) -> Self: ... obj: Incomplete func: Incomplete diff --git a/stubs/pony/pony/orm/sqlbuilding.pyi b/stubs/pony/pony/orm/sqlbuilding.pyi index f3aeca3077f6..abfe2f849511 100644 --- a/stubs/pony/pony/orm/sqlbuilding.pyi +++ b/stubs/pony/pony/orm/sqlbuilding.pyi @@ -7,6 +7,7 @@ from typing import ClassVar class AstError(Exception): ... class Param: + __slots__ = ("style", "id", "paramkey", "converter", "optimistic") style: Incomplete id: Incomplete paramkey: Incomplete @@ -16,12 +17,14 @@ class Param: def eval(param, values): ... class CompositeParam(Param): + __slots__ = ("items", "func") items: Iterable[Param | Value] func: Incomplete def __init__(param, paramstyle, paramkey, items: Iterable[Param | Value], func) -> None: ... def eval(param, values): ... class Value: + __slots__ = ("paramstyle", "value") paramstyle: Incomplete value: Incomplete def __init__(self, paramstyle, value) -> None: ... diff --git a/stubs/protobuf/google/protobuf/any_pb2.pyi b/stubs/protobuf/google/protobuf/any_pb2.pyi index c12c7e4a8133..175f0c8cc9bf 100644 --- a/stubs/protobuf/google/protobuf/any_pb2.pyi +++ b/stubs/protobuf/google/protobuf/any_pb2.pyi @@ -130,6 +130,8 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t } """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor TYPE_URL_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/api_pb2.pyi b/stubs/protobuf/google/protobuf/api_pb2.pyi index 71e8ca47853f..88a8f60b6f99 100644 --- a/stubs/protobuf/google/protobuf/api_pb2.pyi +++ b/stubs/protobuf/google/protobuf/api_pb2.pyi @@ -57,6 +57,8 @@ class Api(google.protobuf.message.Message): detailed terminology. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -149,6 +151,8 @@ global___Api = Api class Method(google.protobuf.message.Message): """Method represents a method of an API interface.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -289,6 +293,8 @@ class Mixin(google.protobuf.message.Message): } """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi index a6f744c26074..ce1f34b4d5f8 100644 --- a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi +++ b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi @@ -37,6 +37,8 @@ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class Version(google.protobuf.message.Message): """The version number of protocol compiler.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor MAJOR_FIELD_NUMBER: builtins.int @@ -71,6 +73,8 @@ global___Version = Version class CodeGeneratorRequest(google.protobuf.message.Message): """An encoded CodeGeneratorRequest is written to the plugin's stdin.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor FILE_TO_GENERATE_FIELD_NUMBER: builtins.int @@ -159,6 +163,8 @@ global___CodeGeneratorRequest = CodeGeneratorRequest class CodeGeneratorResponse(google.protobuf.message.Message): """The plugin writes an encoded CodeGeneratorResponse to stdout.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Feature: @@ -184,6 +190,8 @@ class CodeGeneratorResponse(google.protobuf.message.Message): class File(google.protobuf.message.Message): """Represents a single generated file.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index d3bc182e4be3..0a51e16bf28c 100644 --- a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -109,6 +109,8 @@ class FileDescriptorSet(google.protobuf.message.Message): files it parses. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor FILE_FIELD_NUMBER: builtins.int @@ -123,6 +125,8 @@ global___FileDescriptorSet = FileDescriptorSet class FileDescriptorProto(google.protobuf.message.Message): """Describes a complete .proto file.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -263,10 +267,13 @@ global___FileDescriptorProto = FileDescriptorProto class DescriptorProto(google.protobuf.message.Message): """Describes a message type.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class ExtensionRange(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor START_FIELD_NUMBER: builtins.int @@ -297,6 +304,8 @@ class DescriptorProto(google.protobuf.message.Message): not overlap. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor START_FIELD_NUMBER: builtins.int @@ -393,6 +402,7 @@ global___DescriptorProto = DescriptorProto @typing.final class ExtensionRangeOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _VerificationState: @@ -417,6 +427,7 @@ class ExtensionRangeOptions(google.protobuf.message.Message): @typing.final class Declaration(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor NUMBER_FIELD_NUMBER: builtins.int @@ -523,6 +534,8 @@ global___ExtensionRangeOptions = ExtensionRangeOptions class FieldDescriptorProto(google.protobuf.message.Message): """Describes a field within a message.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Type: @@ -783,6 +796,8 @@ global___FieldDescriptorProto = FieldDescriptorProto class OneofDescriptorProto(google.protobuf.message.Message): """Describes a oneof.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -800,6 +815,8 @@ global___OneofDescriptorProto = OneofDescriptorProto class EnumDescriptorProto(google.protobuf.message.Message): """Describes an enum type.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final @@ -812,6 +829,8 @@ class EnumDescriptorProto(google.protobuf.message.Message): domain. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor START_FIELD_NUMBER: builtins.int @@ -881,6 +900,8 @@ global___EnumDescriptorProto = EnumDescriptorProto class EnumValueDescriptorProto(google.protobuf.message.Message): """Describes a value within an enum.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -908,6 +929,8 @@ global___EnumValueDescriptorProto = EnumValueDescriptorProto class ServiceDescriptorProto(google.protobuf.message.Message): """Describes a service.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -934,6 +957,8 @@ global___ServiceDescriptorProto = ServiceDescriptorProto class MethodDescriptorProto(google.protobuf.message.Message): """Describes a method of a service.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -1033,6 +1058,8 @@ class FileOptions(google.protobuf.message.Message): to automatically assign option numbers. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _OptimizeMode: @@ -1321,6 +1348,7 @@ global___FileOptions = FileOptions @typing.final class MessageOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor MESSAGE_SET_WIRE_FORMAT_FIELD_NUMBER: builtins.int @@ -1462,6 +1490,7 @@ global___MessageOptions = MessageOptions @typing.final class FieldOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _CType: @@ -1577,6 +1606,7 @@ class FieldOptions(google.protobuf.message.Message): @typing.final class EditionDefault(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor EDITION_FIELD_NUMBER: builtins.int @@ -1592,6 +1622,8 @@ class FieldOptions(google.protobuf.message.Message): class FeatureSupport(google.protobuf.message.Message): """Information about the support window of a feature.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor EDITION_INTRODUCED_FIELD_NUMBER: builtins.int @@ -1845,6 +1877,7 @@ global___FieldOptions = FieldOptions @typing.final class OneofOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor FEATURES_FIELD_NUMBER: builtins.int @@ -1878,6 +1911,7 @@ global___OneofOptions = OneofOptions @typing.final class EnumOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor ALLOW_ALIAS_FIELD_NUMBER: builtins.int @@ -1959,6 +1993,7 @@ global___EnumOptions = EnumOptions @typing.final class EnumValueOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor DEPRECATED_FIELD_NUMBER: builtins.int @@ -2037,6 +2072,7 @@ global___EnumValueOptions = EnumValueOptions @typing.final class ServiceOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor FEATURES_FIELD_NUMBER: builtins.int @@ -2086,6 +2122,7 @@ global___ServiceOptions = ServiceOptions @typing.final class MethodOptions(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _IdempotencyLevel: @@ -2184,6 +2221,8 @@ class UninterpretedOption(google.protobuf.message.Message): in them. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final @@ -2195,6 +2234,8 @@ class UninterpretedOption(google.protobuf.message.Message): "foo.(bar.baz).moo". """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_PART_FIELD_NUMBER: builtins.int @@ -2290,6 +2331,8 @@ class FeatureSet(google.protobuf.message.Message): conflict here. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _FieldPresence: @@ -2487,6 +2530,8 @@ class FeatureSetDefaults(google.protobuf.message.Message): for the closest matching edition, followed by proto merges. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final @@ -2497,6 +2542,8 @@ class FeatureSetDefaults(google.protobuf.message.Message): be used. This field must be in strict ascending order by edition. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor EDITION_FIELD_NUMBER: builtins.int @@ -2576,10 +2623,13 @@ class SourceCodeInfo(google.protobuf.message.Message): FileDescriptorProto was generated. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class Location(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor PATH_FIELD_NUMBER: builtins.int @@ -2763,10 +2813,13 @@ class GeneratedCodeInfo(google.protobuf.message.Message): source file, but may contain references to different source .proto files. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class Annotation(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Semantic: diff --git a/stubs/protobuf/google/protobuf/duration_pb2.pyi b/stubs/protobuf/google/protobuf/duration_pb2.pyi index 2cb846889f4d..67cd9b254692 100644 --- a/stubs/protobuf/google/protobuf/duration_pb2.pyi +++ b/stubs/protobuf/google/protobuf/duration_pb2.pyi @@ -103,6 +103,8 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn microsecond should be expressed in JSON format as "3.000001s". """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor SECONDS_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/empty_pb2.pyi b/stubs/protobuf/google/protobuf/empty_pb2.pyi index 317979279540..d1490886870b 100644 --- a/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -50,6 +50,8 @@ class Empty(google.protobuf.message.Message): } """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor def __init__(self) -> None: ... diff --git a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi index 82dea7a11b56..b8eb88bd271e 100644 --- a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi +++ b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi @@ -246,6 +246,8 @@ class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_k `INVALID_ARGUMENT` error if any path is unmappable. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor PATHS_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/internal/containers.pyi b/stubs/protobuf/google/protobuf/internal/containers.pyi index 99c6efa160d8..bdcd5208b9d6 100644 --- a/stubs/protobuf/google/protobuf/internal/containers.pyi +++ b/stubs/protobuf/google/protobuf/internal/containers.pyi @@ -18,6 +18,7 @@ class _ValueChecker(Protocol[_T]): def DefaultValue(self) -> _T: ... class BaseContainer(Sequence[_T]): + __slots__ = ["_message_listener", "_values"] def __init__(self, message_listener: MessageListener) -> None: ... def __len__(self) -> int: ... def __ne__(self, other: object) -> bool: ... @@ -30,6 +31,7 @@ class BaseContainer(Sequence[_T]): def __getitem__(self, key: slice) -> list[_T]: ... class RepeatedScalarFieldContainer(BaseContainer[_ScalarV]): + __slots__ = ["_type_checker"] def __init__(self, message_listener: MessageListener, type_checker: _ValueChecker[_ScalarV]) -> None: ... def append(self, value: _ScalarV) -> None: ... def insert(self, key: int, value: _ScalarV) -> None: ... @@ -45,6 +47,7 @@ class RepeatedScalarFieldContainer(BaseContainer[_ScalarV]): def __eq__(self, other: object) -> bool: ... class RepeatedCompositeFieldContainer(BaseContainer[_MessageV]): + __slots__ = ["_message_descriptor"] def __init__(self, message_listener: MessageListener, message_descriptor: Descriptor) -> None: ... def add(self, **kwargs: Any) -> _MessageV: ... def append(self, value: _MessageV) -> None: ... @@ -57,6 +60,7 @@ class RepeatedCompositeFieldContainer(BaseContainer[_MessageV]): def __eq__(self, other: object) -> bool: ... class ScalarMap(MutableMapping[_K, _ScalarV]): + __slots__ = ["_key_checker", "_value_checker", "_values", "_message_listener", "_entry_descriptor"] def __init__( self, message_listener: MessageListener, @@ -82,6 +86,7 @@ class ScalarMap(MutableMapping[_K, _ScalarV]): def GetEntryClass(self) -> GeneratedProtocolMessageType: ... class MessageMap(MutableMapping[_K, _MessageV]): + __slots__ = ["_key_checker", "_values", "_message_listener", "_message_descriptor", "_entry_descriptor"] def __init__( self, message_listener: MessageListener, diff --git a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi index 8e9e19618881..6950e5431777 100644 --- a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +++ b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi @@ -7,6 +7,7 @@ from typing_extensions import TypeAlias from google.protobuf import struct_pb2 class Any: + __slots__ = () type_url: str value: Incomplete def Pack(self, msg, type_url_prefix: str = "type.googleapis.com/", deterministic=None) -> None: ... @@ -15,6 +16,7 @@ class Any: def Is(self, descriptor) -> bool: ... class Timestamp: + __slots__ = () def ToJsonString(self) -> str: ... seconds: int nanos: int @@ -32,6 +34,7 @@ class Timestamp: def FromDatetime(self, dt: datetime) -> None: ... class Duration: + __slots__ = () def ToJsonString(self) -> str: ... seconds: int nanos: int @@ -48,6 +51,7 @@ class Duration: def FromTimedelta(self, td: timedelta) -> None: ... class FieldMask: + __slots__ = () def ToJsonString(self) -> str: ... def FromJsonString(self, value: tAny) -> None: ... def IsValidForDescriptor(self, message_descriptor: tAny): ... @@ -63,6 +67,7 @@ _StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | float _StructValueArg: TypeAlias = _StructValue | Mapping[str, _StructValueArg] | Sequence[_StructValueArg] class Struct: + __slots__ = () def __getitem__(self, key: str) -> _StructValue: ... def __setitem__(self, key: str, value: _StructValueArg) -> None: ... def __delitem__(self, key: str) -> None: ... @@ -76,6 +81,7 @@ class Struct: def update(self, dictionary: SupportsItems[str, _StructValueArg]) -> None: ... class ListValue: + __slots__ = () def __len__(self) -> int: ... def append(self, value: _StructValue) -> None: ... def extend(self, elem_seq: Iterable[_StructValue]) -> None: ... diff --git a/stubs/protobuf/google/protobuf/message.pyi b/stubs/protobuf/google/protobuf/message.pyi index ea1d636ee261..25577b582620 100644 --- a/stubs/protobuf/google/protobuf/message.pyi +++ b/stubs/protobuf/google/protobuf/message.pyi @@ -12,6 +12,7 @@ class DecodeError(Error): ... class EncodeError(Error): ... class Message: + __slots__ = [] DESCRIPTOR: Descriptor | _upb_Descriptor def __deepcopy__(self, memo: Any = None) -> Self: ... def __eq__(self, other_msg): ... diff --git a/stubs/protobuf/google/protobuf/source_context_pb2.pyi b/stubs/protobuf/google/protobuf/source_context_pb2.pyi index 9d74fb3d5926..528b4d569fdc 100644 --- a/stubs/protobuf/google/protobuf/source_context_pb2.pyi +++ b/stubs/protobuf/google/protobuf/source_context_pb2.pyi @@ -46,6 +46,8 @@ class SourceContext(google.protobuf.message.Message): protobuf element, like the file in which it is defined. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor FILE_NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/struct_pb2.pyi b/stubs/protobuf/google/protobuf/struct_pb2.pyi index 8e63dabfc2f1..cbf96c0a3157 100644 --- a/stubs/protobuf/google/protobuf/struct_pb2.pyi +++ b/stubs/protobuf/google/protobuf/struct_pb2.pyi @@ -82,10 +82,13 @@ class Struct(google.protobuf.message.Message, google.protobuf.internal.well_know The JSON representation for `Struct` is JSON object. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class FieldsEntry(google.protobuf.message.Message): + __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor KEY_FIELD_NUMBER: builtins.int @@ -117,6 +120,8 @@ class Value(google.protobuf.message.Message): The JSON representation for `Value` is JSON value. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NULL_VALUE_FIELD_NUMBER: builtins.int @@ -202,6 +207,8 @@ class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_k The JSON representation for `ListValue` is JSON array. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUES_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi index 52daff363ddf..04f468f13607 100644 --- a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi +++ b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi @@ -134,6 +134,8 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k ) to obtain a formatter capable of generating timestamps in this format. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor SECONDS_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/type_pb2.pyi b/stubs/protobuf/google/protobuf/type_pb2.pyi index 4d3fc1cb6577..804dd2f3363b 100644 --- a/stubs/protobuf/google/protobuf/type_pb2.pyi +++ b/stubs/protobuf/google/protobuf/type_pb2.pyi @@ -79,6 +79,8 @@ global___Syntax = Syntax class Type(google.protobuf.message.Message): """A protocol buffer message type.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -148,6 +150,8 @@ global___Type = Type class Field(google.protobuf.message.Message): """A single field of a message type.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Kind: @@ -348,6 +352,8 @@ global___Field = Field class Enum(google.protobuf.message.Message): """Enum type definition.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -409,6 +415,8 @@ global___Enum = Enum class EnumValue(google.protobuf.message.Message): """Enum value definition.""" + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -439,6 +447,8 @@ class Option(google.protobuf.message.Message): enumeration, etc. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi index b3d875bccf67..2bded1d92877 100644 --- a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi +++ b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi @@ -67,6 +67,8 @@ class DoubleValue(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -87,6 +89,8 @@ class FloatValue(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -107,6 +111,8 @@ class Int64Value(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -127,6 +133,8 @@ class UInt64Value(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -147,6 +155,8 @@ class Int32Value(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -167,6 +177,8 @@ class UInt32Value(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -187,6 +199,8 @@ class BoolValue(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -207,6 +221,8 @@ class StringValue(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -227,6 +243,8 @@ class BytesValue(google.protobuf.message.Message): has no plan to be removed. """ + __slots__ = () + DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int diff --git a/stubs/psutil/psutil/_psosx.pyi b/stubs/psutil/psutil/_psosx.pyi index 075aba89aef9..196f8baf34ad 100644 --- a/stubs/psutil/psutil/_psosx.pyi +++ b/stubs/psutil/psutil/_psosx.pyi @@ -79,6 +79,7 @@ def is_zombie(pid): ... def wrap_exceptions(fun): ... class Process: + __slots__ = ["_cache", "_name", "_ppid", "pid"] pid: Any def __init__(self, pid) -> None: ... def oneshot_enter(self) -> None: ... diff --git a/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi b/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi index ae19c98e180d..83df57a0ca30 100644 --- a/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi +++ b/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi @@ -11,6 +11,17 @@ class _SupportsGraphident(Protocol): # code, filename and packagepath are always initialized to None. But they can be given a value later. class Node: # Compiled code. See stdlib.builtins.compile + __slots__ = [ + "code", + "filename", + "graphident", + "identifier", + "packagepath", + "_deferred_imports", + "_global_attr_names", + "_starimported_ignored_module_names", + "_submodule_basename_to_node", + ] code: CodeType | None filename: str | None graphident: str diff --git a/stubs/python-dateutil/dateutil/_common.pyi b/stubs/python-dateutil/dateutil/_common.pyi index 75bf74c526e3..af892a5d7a0d 100644 --- a/stubs/python-dateutil/dateutil/_common.pyi +++ b/stubs/python-dateutil/dateutil/_common.pyi @@ -1,6 +1,7 @@ from typing_extensions import Self class weekday: + __slots__ = ["weekday", "n"] def __init__(self, weekday: int, n: int | None = None) -> None: ... def __call__(self, n: int) -> Self: ... def __eq__(self, other: object) -> bool: ... diff --git a/stubs/python-dateutil/dateutil/parser/_parser.pyi b/stubs/python-dateutil/dateutil/parser/_parser.pyi index afdeceb0f4a9..e4784c89c109 100644 --- a/stubs/python-dateutil/dateutil/parser/_parser.pyi +++ b/stubs/python-dateutil/dateutil/parser/_parser.pyi @@ -108,6 +108,7 @@ def parse( class _tzparser: class _result(_resultbase): + __slots__ = ["stdabbr", "stdoffset", "dstabbr", "dstoffset", "start", "end"] stdabbr: str | None stdoffset: int | None dstabbr: str | None @@ -116,6 +117,7 @@ class _tzparser: end: _attr class _attr(_resultbase): + __slots__ = ["month", "week", "weekday", "yday", "jyday", "day", "time"] month: int | None week: int | None weekday: int | None diff --git a/stubs/python-dateutil/dateutil/rrule.pyi b/stubs/python-dateutil/dateutil/rrule.pyi index a4ebcacdc3f2..c63010871f87 100644 --- a/stubs/python-dateutil/dateutil/rrule.pyi +++ b/stubs/python-dateutil/dateutil/rrule.pyi @@ -112,6 +112,23 @@ class rrule(rrulebase): _RRule: TypeAlias = rrule class _iterinfo: + __slots__ = [ + "rrule", + "lastyear", + "lastmonth", + "yearlen", + "nextyearlen", + "yearordinal", + "yearweekday", + "mmask", + "mrange", + "mdaymask", + "nmdaymask", + "wdaymask", + "wnomask", + "nwdaymask", + "eastermask", + ] rrule: _RRule def __init__(self, rrule: _RRule) -> None: ... yearlen: int | None diff --git a/stubs/python-dateutil/dateutil/tz/tz.pyi b/stubs/python-dateutil/dateutil/tz/tz.pyi index 242f8d11bbd0..475ace6a4bd7 100644 --- a/stubs/python-dateutil/dateutil/tz/tz.pyi +++ b/stubs/python-dateutil/dateutil/tz/tz.pyi @@ -56,6 +56,7 @@ class tzlocal(_tzinfo): __reduce__ = object.__reduce__ class _ttinfo: + __slots__ = ["offset", "delta", "isdst", "abbr", "isstd", "isgmt", "dstoffset"] offset: float delta: timedelta isdst: bool diff --git a/stubs/shapely/shapely/geometry/base.pyi b/stubs/shapely/shapely/geometry/base.pyi index 9a4a2d96a1b8..0aedd8d71ca4 100644 --- a/stubs/shapely/shapely/geometry/base.pyi +++ b/stubs/shapely/shapely/geometry/base.pyi @@ -31,6 +31,7 @@ class JOIN_STYLE: bevel: Literal[BufferJoinStyle.bevel] class BaseGeometry(Geometry): + __slots__ = [] @deprecated( "Directly calling 'BaseGeometry()' is deprecated. To create an empty geometry, " "use one of the subclasses instead, for example 'GeometryCollection()'." @@ -264,6 +265,7 @@ class BaseGeometry(Geometry): _GeoT_co = TypeVar("_GeoT_co", bound=Geometry, default=BaseGeometry, covariant=True) class BaseMultipartGeometry(BaseGeometry, Generic[_GeoT_co]): + __slots__ = [] @property def coords(self) -> NoReturn: ... @property diff --git a/stubs/shapely/shapely/geometry/collection.pyi b/stubs/shapely/shapely/geometry/collection.pyi index 455e39d2c706..b08a47388460 100644 --- a/stubs/shapely/shapely/geometry/collection.pyi +++ b/stubs/shapely/shapely/geometry/collection.pyi @@ -7,6 +7,7 @@ from .base import BaseMultipartGeometry, GeometrySequence, _GeoT_co class GeometryCollection(BaseMultipartGeometry[_GeoT_co]): # Overloads of __new__ are used because mypy is unable to narrow the typevar otherwise + __slots__ = [] @overload def __new__( self, geoms: BaseMultipartGeometry[_GeoT_co] | GeometrySequence[BaseMultipartGeometry[_GeoT_co]] | Collection[_GeoT_co] diff --git a/stubs/shapely/shapely/geometry/linestring.pyi b/stubs/shapely/shapely/geometry/linestring.pyi index 44176310d338..830fe0c09092 100644 --- a/stubs/shapely/shapely/geometry/linestring.pyi +++ b/stubs/shapely/shapely/geometry/linestring.pyi @@ -15,6 +15,7 @@ __all__ = ["LineString"] _ConvertibleToLineString: TypeAlias = LineString | ArrayLikeSeq[float] | Iterable[Point | Iterable[SupportsFloat]] class LineString(BaseGeometry): + __slots__ = [] def __new__(self, coordinates: _ConvertibleToLineString | None = None) -> Self: ... def svg(self, scale_factor: float = 1.0, stroke_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] def offset_curve( diff --git a/stubs/shapely/shapely/geometry/multilinestring.pyi b/stubs/shapely/shapely/geometry/multilinestring.pyi index b911938cda43..9f2951c30779 100644 --- a/stubs/shapely/shapely/geometry/multilinestring.pyi +++ b/stubs/shapely/shapely/geometry/multilinestring.pyi @@ -8,6 +8,7 @@ from .multipoint import MultiPoint __all__ = ["MultiLineString"] class MultiLineString(BaseMultipartGeometry[LineString]): + __slots__ = [] def __new__(self, lines: BaseMultipartGeometry | Collection[_ConvertibleToLineString] | None = None) -> Self: ... def svg(self, scale_factor: float = 1.0, stroke_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] # more precise base overrides diff --git a/stubs/shapely/shapely/geometry/multipoint.pyi b/stubs/shapely/shapely/geometry/multipoint.pyi index dddc39d9c269..451d9c83f2bd 100644 --- a/stubs/shapely/shapely/geometry/multipoint.pyi +++ b/stubs/shapely/shapely/geometry/multipoint.pyi @@ -13,6 +13,7 @@ class MultiPoint(BaseMultipartGeometry[Point]): # * `Sequence` is more correct but it will lead to False positives with common types # like np.ndarray, pd.Index, pd.Series, ... # I went with Collection as false negatives seem better to me than false positives in this case + __slots__ = [] def __new__(self, points: MultiPoint | Collection[_PointLike] | None = None) -> Self: ... def svg(self, scale_factor: float = 1.0, fill_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] # more precise base overrides diff --git a/stubs/shapely/shapely/geometry/multipolygon.pyi b/stubs/shapely/shapely/geometry/multipolygon.pyi index 95da6beef6eb..38d2ef8d38c4 100644 --- a/stubs/shapely/shapely/geometry/multipolygon.pyi +++ b/stubs/shapely/shapely/geometry/multipolygon.pyi @@ -8,6 +8,7 @@ from .polygon import Polygon, _PolygonHolesLike, _PolygonShellLike __all__ = ["MultiPolygon"] class MultiPolygon(BaseMultipartGeometry[Polygon]): + __slots__ = [] def __new__( self, polygons: ( diff --git a/stubs/shapely/shapely/geometry/point.pyi b/stubs/shapely/shapely/geometry/point.pyi index e9ac4e18169e..ff3d5bceb330 100644 --- a/stubs/shapely/shapely/geometry/point.pyi +++ b/stubs/shapely/shapely/geometry/point.pyi @@ -11,6 +11,7 @@ __all__ = ["Point"] _PointLike: TypeAlias = Point | Iterable[float] | ArrayLikeSeq[float] class Point(BaseGeometry): + __slots__ = [] @overload # no args: empty point def __new__(self) -> Self: ... @overload # one arg: (x, y[, z]) tuple or a Point instance diff --git a/stubs/shapely/shapely/geometry/polygon.pyi b/stubs/shapely/shapely/geometry/polygon.pyi index ad5ad49990ab..962bdd40ad78 100644 --- a/stubs/shapely/shapely/geometry/polygon.pyi +++ b/stubs/shapely/shapely/geometry/polygon.pyi @@ -13,6 +13,7 @@ _PolygonShellLike: TypeAlias = Polygon | _ConvertibleToLinearRing | None _PolygonHolesLike: TypeAlias = Collection[_ConvertibleToLinearRing | None] | None class LinearRing(LineString): + __slots__ = [] def __new__(self, coordinates: _ConvertibleToLinearRing | None = None) -> Self: ... @property def is_ccw(self) -> bool: ... @@ -28,6 +29,7 @@ class InteriorRingSequence: def __getitem__(self, key: slice) -> list[LinearRing]: ... class Polygon(BaseGeometry): + __slots__ = [] def __new__(self, shell: _PolygonShellLike = None, holes: _PolygonHolesLike = None) -> Self: ... @property def exterior(self) -> LinearRing: ... diff --git a/stubs/translationstring/translationstring/__init__.pyi b/stubs/translationstring/translationstring/__init__.pyi index eb7af77fec62..51bf7f775717 100644 --- a/stubs/translationstring/translationstring/__init__.pyi +++ b/stubs/translationstring/translationstring/__init__.pyi @@ -57,6 +57,7 @@ class _Pluralizer(Protocol): ) -> str: ... class TranslationString(str): + __slots__ = ("domain", "context", "default", "mapping") domain: str | None context: str | None default: str diff --git a/stubs/xlrd/xlrd/sheet.pyi b/stubs/xlrd/xlrd/sheet.pyi index 9d6193654642..8a42beaaccc1 100644 --- a/stubs/xlrd/xlrd/sheet.pyi +++ b/stubs/xlrd/xlrd/sheet.pyi @@ -42,6 +42,7 @@ cellty_from_fmtty: Final[dict[int, int]] ctype_text: Final[dict[int, str]] class Cell(BaseObject): + __slots__ = ["ctype", "value", "xf_index"] ctype: int value: str xf_index: int | None @@ -58,6 +59,18 @@ class Colinfo(BaseObject): collapsed: int class Rowinfo(BaseObject): + __slots__ = ( + "height", + "has_default_height", + "outline_level", + "outline_group_starts_ends", + "hidden", + "height_mismatch", + "has_default_xf_index", + "xf_index", + "additional_space_above", + "additional_space_below", + ) height: int | None has_default_height: int | None outline_level: int | None From 2d49712a8f740e2b8e66b06ccaee0418242d583d Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 10:24:04 -0700 Subject: [PATCH 2/7] empty list slots --- stubs/cffi/cffi/backend_ctypes.pyi | 4 ++-- stubs/pony/pony/orm/core.pyi | 8 ++++---- stubs/pony/pony/orm/dbproviders/mysql.pyi | 2 +- stubs/pony/pony/orm/dbproviders/sqlite.pyi | 2 +- stubs/protobuf/google/protobuf/message.pyi | 2 +- stubs/shapely/shapely/geometry/base.pyi | 4 ++-- stubs/shapely/shapely/geometry/collection.pyi | 2 +- stubs/shapely/shapely/geometry/linestring.pyi | 2 +- stubs/shapely/shapely/geometry/multilinestring.pyi | 2 +- stubs/shapely/shapely/geometry/multipoint.pyi | 2 +- stubs/shapely/shapely/geometry/multipolygon.pyi | 2 +- stubs/shapely/shapely/geometry/point.pyi | 2 +- stubs/shapely/shapely/geometry/polygon.pyi | 4 ++-- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/stubs/cffi/cffi/backend_ctypes.pyi b/stubs/cffi/cffi/backend_ctypes.pyi index 0addca928780..04c0e8a8ffbe 100644 --- a/stubs/cffi/cffi/backend_ctypes.pyi +++ b/stubs/cffi/cffi/backend_ctypes.pyi @@ -24,11 +24,11 @@ class CTypesData: def __repr__(self, c_name: str | None = None): ... class CTypesGenericPrimitive(CTypesData): - __slots__ = [] + __slots__: list[str] = [] def __hash__(self) -> int: ... class CTypesGenericArray(CTypesData): - __slots__ = [] + __slots__: list[str] = [] def __iter__(self): ... class CTypesGenericPtr(CTypesData): diff --git a/stubs/pony/pony/orm/core.pyi b/stubs/pony/pony/orm/core.pyi index e0510c6e1df5..87c311910ab5 100644 --- a/stubs/pony/pony/orm/core.pyi +++ b/stubs/pony/pony/orm/core.pyi @@ -573,10 +573,10 @@ class Attribute: def describe(attr) -> str: ... class Optional(Attribute): - __slots__ = [] + __slots__: list[str] = [] class Required(Attribute): - __slots__ = [] + __slots__: list[str] = [] def validate(attr, val, obj=None, entity=None, from_db: bool = False): ... class Discriminator(Required): @@ -605,7 +605,7 @@ def composite_index(*attrs) -> None: ... def composite_key(*attrs) -> None: ... class PrimaryKey(Required): - __slots__ = [] + __slots__: list[str] = [] def __new__(cls, *args, **kwargs): ... class Collection(Attribute): @@ -657,7 +657,7 @@ def construct_batchload_criteria_list( ): ... class Set(Collection): - __slots__ = [] + __slots__: list[str] = [] def validate(attr, val, obj=None, entity=None, from_db: bool = False): ... def prefetch_load_all(attr, objects): ... def load(attr, obj, items=None): ... diff --git a/stubs/pony/pony/orm/dbproviders/mysql.pyi b/stubs/pony/pony/orm/dbproviders/mysql.pyi index cfc02a113ea7..79e9dbc4ed09 100644 --- a/stubs/pony/pony/orm/dbproviders/mysql.pyi +++ b/stubs/pony/pony/orm/dbproviders/mysql.pyi @@ -21,7 +21,7 @@ class MySQLTranslator(SQLTranslator): dialect: ClassVar[str] class MySQLValue(Value): - __slots__ = [] + __slots__: list[str] = [] class MySQLBuilder(SQLBuilder): dialect: ClassVar[str] diff --git a/stubs/pony/pony/orm/dbproviders/sqlite.pyi b/stubs/pony/pony/orm/dbproviders/sqlite.pyi index c19310227959..89f8baa53f73 100644 --- a/stubs/pony/pony/orm/dbproviders/sqlite.pyi +++ b/stubs/pony/pony/orm/dbproviders/sqlite.pyi @@ -31,7 +31,7 @@ class SQLiteTranslator(SQLTranslator): StringMixin_LOWER: Incomplete class SQLiteValue(Value): - __slots__ = [] + __slots__: list[str] = [] class SQLiteBuilder(SQLBuilder): dialect: ClassVar[str] diff --git a/stubs/protobuf/google/protobuf/message.pyi b/stubs/protobuf/google/protobuf/message.pyi index 25577b582620..57430d96c453 100644 --- a/stubs/protobuf/google/protobuf/message.pyi +++ b/stubs/protobuf/google/protobuf/message.pyi @@ -12,7 +12,7 @@ class DecodeError(Error): ... class EncodeError(Error): ... class Message: - __slots__ = [] + __slots__: list[str] = [] DESCRIPTOR: Descriptor | _upb_Descriptor def __deepcopy__(self, memo: Any = None) -> Self: ... def __eq__(self, other_msg): ... diff --git a/stubs/shapely/shapely/geometry/base.pyi b/stubs/shapely/shapely/geometry/base.pyi index 0aedd8d71ca4..b641a608375e 100644 --- a/stubs/shapely/shapely/geometry/base.pyi +++ b/stubs/shapely/shapely/geometry/base.pyi @@ -31,7 +31,7 @@ class JOIN_STYLE: bevel: Literal[BufferJoinStyle.bevel] class BaseGeometry(Geometry): - __slots__ = [] + __slots__: list[str] = [] @deprecated( "Directly calling 'BaseGeometry()' is deprecated. To create an empty geometry, " "use one of the subclasses instead, for example 'GeometryCollection()'." @@ -265,7 +265,7 @@ class BaseGeometry(Geometry): _GeoT_co = TypeVar("_GeoT_co", bound=Geometry, default=BaseGeometry, covariant=True) class BaseMultipartGeometry(BaseGeometry, Generic[_GeoT_co]): - __slots__ = [] + __slots__: list[str] = [] @property def coords(self) -> NoReturn: ... @property diff --git a/stubs/shapely/shapely/geometry/collection.pyi b/stubs/shapely/shapely/geometry/collection.pyi index b08a47388460..adfe1cc648f6 100644 --- a/stubs/shapely/shapely/geometry/collection.pyi +++ b/stubs/shapely/shapely/geometry/collection.pyi @@ -7,7 +7,7 @@ from .base import BaseMultipartGeometry, GeometrySequence, _GeoT_co class GeometryCollection(BaseMultipartGeometry[_GeoT_co]): # Overloads of __new__ are used because mypy is unable to narrow the typevar otherwise - __slots__ = [] + __slots__: list[str] = [] @overload def __new__( self, geoms: BaseMultipartGeometry[_GeoT_co] | GeometrySequence[BaseMultipartGeometry[_GeoT_co]] | Collection[_GeoT_co] diff --git a/stubs/shapely/shapely/geometry/linestring.pyi b/stubs/shapely/shapely/geometry/linestring.pyi index 830fe0c09092..4c5b37ab4df0 100644 --- a/stubs/shapely/shapely/geometry/linestring.pyi +++ b/stubs/shapely/shapely/geometry/linestring.pyi @@ -15,7 +15,7 @@ __all__ = ["LineString"] _ConvertibleToLineString: TypeAlias = LineString | ArrayLikeSeq[float] | Iterable[Point | Iterable[SupportsFloat]] class LineString(BaseGeometry): - __slots__ = [] + __slots__: list[str] = [] def __new__(self, coordinates: _ConvertibleToLineString | None = None) -> Self: ... def svg(self, scale_factor: float = 1.0, stroke_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] def offset_curve( diff --git a/stubs/shapely/shapely/geometry/multilinestring.pyi b/stubs/shapely/shapely/geometry/multilinestring.pyi index 9f2951c30779..c4c561f4f803 100644 --- a/stubs/shapely/shapely/geometry/multilinestring.pyi +++ b/stubs/shapely/shapely/geometry/multilinestring.pyi @@ -8,7 +8,7 @@ from .multipoint import MultiPoint __all__ = ["MultiLineString"] class MultiLineString(BaseMultipartGeometry[LineString]): - __slots__ = [] + __slots__: list[str] = [] def __new__(self, lines: BaseMultipartGeometry | Collection[_ConvertibleToLineString] | None = None) -> Self: ... def svg(self, scale_factor: float = 1.0, stroke_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] # more precise base overrides diff --git a/stubs/shapely/shapely/geometry/multipoint.pyi b/stubs/shapely/shapely/geometry/multipoint.pyi index 451d9c83f2bd..6647a93404d5 100644 --- a/stubs/shapely/shapely/geometry/multipoint.pyi +++ b/stubs/shapely/shapely/geometry/multipoint.pyi @@ -13,7 +13,7 @@ class MultiPoint(BaseMultipartGeometry[Point]): # * `Sequence` is more correct but it will lead to False positives with common types # like np.ndarray, pd.Index, pd.Series, ... # I went with Collection as false negatives seem better to me than false positives in this case - __slots__ = [] + __slots__: list[str] = [] def __new__(self, points: MultiPoint | Collection[_PointLike] | None = None) -> Self: ... def svg(self, scale_factor: float = 1.0, fill_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] # more precise base overrides diff --git a/stubs/shapely/shapely/geometry/multipolygon.pyi b/stubs/shapely/shapely/geometry/multipolygon.pyi index 38d2ef8d38c4..eb3428ee6f1a 100644 --- a/stubs/shapely/shapely/geometry/multipolygon.pyi +++ b/stubs/shapely/shapely/geometry/multipolygon.pyi @@ -8,7 +8,7 @@ from .polygon import Polygon, _PolygonHolesLike, _PolygonShellLike __all__ = ["MultiPolygon"] class MultiPolygon(BaseMultipartGeometry[Polygon]): - __slots__ = [] + __slots__: list[str] = [] def __new__( self, polygons: ( diff --git a/stubs/shapely/shapely/geometry/point.pyi b/stubs/shapely/shapely/geometry/point.pyi index ff3d5bceb330..f68ae98bc2ed 100644 --- a/stubs/shapely/shapely/geometry/point.pyi +++ b/stubs/shapely/shapely/geometry/point.pyi @@ -11,7 +11,7 @@ __all__ = ["Point"] _PointLike: TypeAlias = Point | Iterable[float] | ArrayLikeSeq[float] class Point(BaseGeometry): - __slots__ = [] + __slots__: list[str] = [] @overload # no args: empty point def __new__(self) -> Self: ... @overload # one arg: (x, y[, z]) tuple or a Point instance diff --git a/stubs/shapely/shapely/geometry/polygon.pyi b/stubs/shapely/shapely/geometry/polygon.pyi index 962bdd40ad78..6d2fd90725a4 100644 --- a/stubs/shapely/shapely/geometry/polygon.pyi +++ b/stubs/shapely/shapely/geometry/polygon.pyi @@ -13,7 +13,7 @@ _PolygonShellLike: TypeAlias = Polygon | _ConvertibleToLinearRing | None _PolygonHolesLike: TypeAlias = Collection[_ConvertibleToLinearRing | None] | None class LinearRing(LineString): - __slots__ = [] + __slots__: list[str] = [] def __new__(self, coordinates: _ConvertibleToLinearRing | None = None) -> Self: ... @property def is_ccw(self) -> bool: ... @@ -29,7 +29,7 @@ class InteriorRingSequence: def __getitem__(self, key: slice) -> list[LinearRing]: ... class Polygon(BaseGeometry): - __slots__ = [] + __slots__: list[str] = [] def __new__(self, shell: _PolygonShellLike = None, holes: _PolygonHolesLike = None) -> Self: ... @property def exterior(self) -> LinearRing: ... From babafe57b16d102364bb46288f85ee1e1b73ccd4 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 13:19:53 -0700 Subject: [PATCH 3/7] not you --- stubs/networkx/networkx/utils/configs.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/networkx/networkx/utils/configs.pyi b/stubs/networkx/networkx/utils/configs.pyi index 255beb56366d..780ccf7233a2 100644 --- a/stubs/networkx/networkx/utils/configs.pyi +++ b/stubs/networkx/networkx/utils/configs.pyi @@ -12,7 +12,6 @@ __all__ = ["Config"] if sys.version_info >= (3, 10): @dataclass(init=False, eq=False, slots=True, kw_only=True, match_args=False) class Config: - __slots__ = () def __init_subclass__(cls, strict: bool = True) -> None: ... def __new__(cls, **kwargs) -> Self: ... def __dir__(self) -> Iterable[str]: ... From cb380bbfe80510cb48eff90ad9440f92c8499ad3 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 13:36:06 -0700 Subject: [PATCH 4/7] just pretend it is a tuple --- stubs/protobuf/@tests/stubtest_allowlist.txt | 4 ++++ stubs/protobuf/google/protobuf/message.pyi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/stubs/protobuf/@tests/stubtest_allowlist.txt b/stubs/protobuf/@tests/stubtest_allowlist.txt index 1d7f7f7a98d6..08d9389d4263 100644 --- a/stubs/protobuf/@tests/stubtest_allowlist.txt +++ b/stubs/protobuf/@tests/stubtest_allowlist.txt @@ -31,3 +31,7 @@ google.protobuf.descriptor.OneofDescriptor # Runtime does not have __iter__ (yet...): hack in spirit of https://github.com/python/typeshed/issues/7813 google.protobuf.internal.well_known_types.ListValue.__iter__ + +# It's a list at runtime, but if we do that pyright complains about incompatible overrides +# in subclasses that use a tuple for __slots__. +google.protobuf.message.Message.__slots__ diff --git a/stubs/protobuf/google/protobuf/message.pyi b/stubs/protobuf/google/protobuf/message.pyi index 57430d96c453..660ffd47c766 100644 --- a/stubs/protobuf/google/protobuf/message.pyi +++ b/stubs/protobuf/google/protobuf/message.pyi @@ -12,7 +12,7 @@ class DecodeError(Error): ... class EncodeError(Error): ... class Message: - __slots__: list[str] = [] + __slots__ = () DESCRIPTOR: Descriptor | _upb_Descriptor def __deepcopy__(self, memo: Any = None) -> Self: ... def __eq__(self, other_msg): ... From 6e8ef2c278941cdc25b6385533ed18b906eb2261 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 13:38:03 -0700 Subject: [PATCH 5/7] another one --- stubs/gevent/@tests/stubtest_allowlist.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/gevent/@tests/stubtest_allowlist.txt b/stubs/gevent/@tests/stubtest_allowlist.txt index f61cdfb4f186..19832db85422 100644 --- a/stubs/gevent/@tests/stubtest_allowlist.txt +++ b/stubs/gevent/@tests/stubtest_allowlist.txt @@ -170,6 +170,7 @@ gevent.socket.getnameinfo gevent.socket.socket.closed gevent.socket.wait_readwrite gevent.socket.wait_write +gevent.socket.socket.__slots__ # we have punted on ssl, the gevent version of these functions have an additional # argument for timeouts/blocking and there are some with different default values From 90ca16d7c8bc3e201019b16d0495b61059b30032 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 13:58:54 -0700 Subject: [PATCH 6/7] Exclude slots in pb2 files These protobuf objects generally have empty __slots__ but their fields can be assigned to. Haven't figured out exactly how they do this but presumably they have some separate storage area. Adding __slots__ causes false positives, so let's drop these slots. --- .../grpc_channelz/v1/channelz_pb2.pyi | 39 -------------- .../grpc_health/v1/health_pb2.pyi | 2 - .../v1alpha/reflection_pb2.pyi | 8 --- stubs/protobuf/google/protobuf/any_pb2.pyi | 2 - stubs/protobuf/google/protobuf/api_pb2.pyi | 6 --- .../google/protobuf/compiler/plugin_pb2.pyi | 8 --- .../google/protobuf/descriptor_pb2.pyi | 53 ------------------- .../protobuf/google/protobuf/duration_pb2.pyi | 2 - stubs/protobuf/google/protobuf/empty_pb2.pyi | 2 - .../google/protobuf/field_mask_pb2.pyi | 2 - .../google/protobuf/source_context_pb2.pyi | 2 - stubs/protobuf/google/protobuf/struct_pb2.pyi | 7 --- .../google/protobuf/timestamp_pb2.pyi | 2 - stubs/protobuf/google/protobuf/type_pb2.pyi | 10 ---- .../protobuf/google/protobuf/wrappers_pb2.pyi | 18 ------- 15 files changed, 163 deletions(-) diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi index adf248e386f4..262fa0f3f89c 100644 --- a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi @@ -10,7 +10,6 @@ DESCRIPTOR: FileDescriptor @final class Channel(message.Message, metaclass=MessageMeta): - __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] CHANNEL_REF_FIELD_NUMBER: ClassVar[int] @@ -33,7 +32,6 @@ class Channel(message.Message, metaclass=MessageMeta): @final class Subchannel(message.Message, metaclass=MessageMeta): - __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] CHANNEL_REF_FIELD_NUMBER: ClassVar[int] @@ -56,7 +54,6 @@ class Subchannel(message.Message, metaclass=MessageMeta): @final class ChannelConnectivityState(message.Message, metaclass=MessageMeta): - __slots__ = () State: Incomplete UNKNOWN: Incomplete IDLE: Incomplete @@ -71,7 +68,6 @@ class ChannelConnectivityState(message.Message, metaclass=MessageMeta): @final class ChannelData(message.Message, metaclass=MessageMeta): - __slots__ = () STATE_FIELD_NUMBER: ClassVar[int] TARGET_FIELD_NUMBER: ClassVar[int] TRACE_FIELD_NUMBER: ClassVar[int] @@ -100,7 +96,6 @@ class ChannelData(message.Message, metaclass=MessageMeta): @final class ChannelTraceEvent(message.Message, metaclass=MessageMeta): - __slots__ = () Severity: Incomplete CT_UNKNOWN: Incomplete CT_INFO: Incomplete @@ -128,7 +123,6 @@ class ChannelTraceEvent(message.Message, metaclass=MessageMeta): @final class ChannelTrace(message.Message, metaclass=MessageMeta): - __slots__ = () NUM_EVENTS_LOGGED_FIELD_NUMBER: ClassVar[int] CREATION_TIMESTAMP_FIELD_NUMBER: ClassVar[int] EVENTS_FIELD_NUMBER: ClassVar[int] @@ -145,7 +139,6 @@ class ChannelTrace(message.Message, metaclass=MessageMeta): @final class ChannelRef(message.Message, metaclass=MessageMeta): - __slots__ = () CHANNEL_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] channel_id: int @@ -155,7 +148,6 @@ class ChannelRef(message.Message, metaclass=MessageMeta): @final class SubchannelRef(message.Message, metaclass=MessageMeta): - __slots__ = () SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] subchannel_id: int @@ -165,7 +157,6 @@ class SubchannelRef(message.Message, metaclass=MessageMeta): @final class SocketRef(message.Message, metaclass=MessageMeta): - __slots__ = () SOCKET_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] socket_id: int @@ -175,7 +166,6 @@ class SocketRef(message.Message, metaclass=MessageMeta): @final class ServerRef(message.Message, metaclass=MessageMeta): - __slots__ = () SERVER_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] server_id: int @@ -185,7 +175,6 @@ class ServerRef(message.Message, metaclass=MessageMeta): @final class Server(message.Message, metaclass=MessageMeta): - __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] LISTEN_SOCKET_FIELD_NUMBER: ClassVar[int] @@ -202,7 +191,6 @@ class Server(message.Message, metaclass=MessageMeta): @final class ServerData(message.Message, metaclass=MessageMeta): - __slots__ = () TRACE_FIELD_NUMBER: ClassVar[int] CALLS_STARTED_FIELD_NUMBER: ClassVar[int] CALLS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] @@ -225,7 +213,6 @@ class ServerData(message.Message, metaclass=MessageMeta): @final class Socket(message.Message, metaclass=MessageMeta): - __slots__ = () REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] LOCAL_FIELD_NUMBER: ClassVar[int] @@ -251,7 +238,6 @@ class Socket(message.Message, metaclass=MessageMeta): @final class SocketData(message.Message, metaclass=MessageMeta): - __slots__ = () STREAMS_STARTED_FIELD_NUMBER: ClassVar[int] STREAMS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] STREAMS_FAILED_FIELD_NUMBER: ClassVar[int] @@ -298,10 +284,8 @@ class SocketData(message.Message, metaclass=MessageMeta): @final class Address(message.Message, metaclass=MessageMeta): - __slots__ = () @final class TcpIpAddress(message.Message, metaclass=MessageMeta): - __slots__ = () IP_ADDRESS_FIELD_NUMBER: ClassVar[int] PORT_FIELD_NUMBER: ClassVar[int] ip_address: bytes @@ -310,14 +294,12 @@ class Address(message.Message, metaclass=MessageMeta): @final class UdsAddress(message.Message, metaclass=MessageMeta): - __slots__ = () FILENAME_FIELD_NUMBER: ClassVar[int] filename: str def __init__(self, filename: str | None = ...) -> None: ... @final class OtherAddress(message.Message, metaclass=MessageMeta): - __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] name: str @@ -340,10 +322,8 @@ class Address(message.Message, metaclass=MessageMeta): @final class Security(message.Message, metaclass=MessageMeta): - __slots__ = () @final class Tls(message.Message, metaclass=MessageMeta): - __slots__ = () STANDARD_NAME_FIELD_NUMBER: ClassVar[int] OTHER_NAME_FIELD_NUMBER: ClassVar[int] LOCAL_CERTIFICATE_FIELD_NUMBER: ClassVar[int] @@ -362,7 +342,6 @@ class Security(message.Message, metaclass=MessageMeta): @final class OtherSecurity(message.Message, metaclass=MessageMeta): - __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] name: str @@ -382,7 +361,6 @@ class Security(message.Message, metaclass=MessageMeta): @final class SocketOption(message.Message, metaclass=MessageMeta): - __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] ADDITIONAL_FIELD_NUMBER: ClassVar[int] @@ -399,7 +377,6 @@ class SocketOption(message.Message, metaclass=MessageMeta): @final class SocketOptionTimeout(message.Message, metaclass=MessageMeta): - __slots__ = () DURATION_FIELD_NUMBER: ClassVar[int] duration: duration_pb2.Duration def __init__(self, duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -407,7 +384,6 @@ class SocketOptionTimeout(message.Message, metaclass=MessageMeta): @final class SocketOptionLinger(message.Message, metaclass=MessageMeta): - __slots__ = () ACTIVE_FIELD_NUMBER: ClassVar[int] DURATION_FIELD_NUMBER: ClassVar[int] active: bool @@ -419,7 +395,6 @@ class SocketOptionLinger(message.Message, metaclass=MessageMeta): @final class SocketOptionTcpInfo(message.Message, metaclass=MessageMeta): - __slots__ = () TCPI_STATE_FIELD_NUMBER: ClassVar[int] TCPI_CA_STATE_FIELD_NUMBER: ClassVar[int] TCPI_RETRANSMITS_FIELD_NUMBER: ClassVar[int] @@ -514,7 +489,6 @@ class SocketOptionTcpInfo(message.Message, metaclass=MessageMeta): @final class GetTopChannelsRequest(message.Message, metaclass=MessageMeta): - __slots__ = () START_CHANNEL_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] start_channel_id: int @@ -524,7 +498,6 @@ class GetTopChannelsRequest(message.Message, metaclass=MessageMeta): @final class GetTopChannelsResponse(message.Message, metaclass=MessageMeta): - __slots__ = () CHANNEL_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] channel: containers.RepeatedCompositeFieldContainer[Channel] @@ -534,7 +507,6 @@ class GetTopChannelsResponse(message.Message, metaclass=MessageMeta): @final class GetServersRequest(message.Message, metaclass=MessageMeta): - __slots__ = () START_SERVER_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] start_server_id: int @@ -544,7 +516,6 @@ class GetServersRequest(message.Message, metaclass=MessageMeta): @final class GetServersResponse(message.Message, metaclass=MessageMeta): - __slots__ = () SERVER_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] server: containers.RepeatedCompositeFieldContainer[Server] @@ -554,7 +525,6 @@ class GetServersResponse(message.Message, metaclass=MessageMeta): @final class GetServerRequest(message.Message, metaclass=MessageMeta): - __slots__ = () SERVER_ID_FIELD_NUMBER: ClassVar[int] server_id: int def __init__(self, server_id: int | None = ...) -> None: ... @@ -562,7 +532,6 @@ class GetServerRequest(message.Message, metaclass=MessageMeta): @final class GetServerResponse(message.Message, metaclass=MessageMeta): - __slots__ = () SERVER_FIELD_NUMBER: ClassVar[int] server: Server def __init__(self, server: Server | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -570,7 +539,6 @@ class GetServerResponse(message.Message, metaclass=MessageMeta): @final class GetServerSocketsRequest(message.Message, metaclass=MessageMeta): - __slots__ = () SERVER_ID_FIELD_NUMBER: ClassVar[int] START_SOCKET_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] @@ -582,7 +550,6 @@ class GetServerSocketsRequest(message.Message, metaclass=MessageMeta): @final class GetServerSocketsResponse(message.Message, metaclass=MessageMeta): - __slots__ = () SOCKET_REF_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] @@ -594,7 +561,6 @@ class GetServerSocketsResponse(message.Message, metaclass=MessageMeta): @final class GetChannelRequest(message.Message, metaclass=MessageMeta): - __slots__ = () CHANNEL_ID_FIELD_NUMBER: ClassVar[int] channel_id: int def __init__(self, channel_id: int | None = ...) -> None: ... @@ -602,7 +568,6 @@ class GetChannelRequest(message.Message, metaclass=MessageMeta): @final class GetChannelResponse(message.Message, metaclass=MessageMeta): - __slots__ = () CHANNEL_FIELD_NUMBER: ClassVar[int] channel: Channel def __init__(self, channel: Channel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -610,7 +575,6 @@ class GetChannelResponse(message.Message, metaclass=MessageMeta): @final class GetSubchannelRequest(message.Message, metaclass=MessageMeta): - __slots__ = () SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] subchannel_id: int def __init__(self, subchannel_id: int | None = ...) -> None: ... @@ -618,7 +582,6 @@ class GetSubchannelRequest(message.Message, metaclass=MessageMeta): @final class GetSubchannelResponse(message.Message, metaclass=MessageMeta): - __slots__ = () SUBCHANNEL_FIELD_NUMBER: ClassVar[int] subchannel: Subchannel def __init__(self, subchannel: Subchannel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... @@ -626,7 +589,6 @@ class GetSubchannelResponse(message.Message, metaclass=MessageMeta): @final class GetSocketRequest(message.Message, metaclass=MessageMeta): - __slots__ = () SOCKET_ID_FIELD_NUMBER: ClassVar[int] SUMMARY_FIELD_NUMBER: ClassVar[int] socket_id: int @@ -636,7 +598,6 @@ class GetSocketRequest(message.Message, metaclass=MessageMeta): @final class GetSocketResponse(message.Message, metaclass=MessageMeta): - __slots__ = () SOCKET_FIELD_NUMBER: ClassVar[int] socket: Socket def __init__(self, socket: Socket | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... diff --git a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi index 0aea338b5eb7..82191f79b659 100644 --- a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi +++ b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi @@ -8,7 +8,6 @@ DESCRIPTOR: FileDescriptor @final class HealthCheckRequest(message.Message, metaclass=MessageMeta): - __slots__ = () SERVICE_FIELD_NUMBER: ClassVar[int] service: str def __init__(self, service: str | None = ...) -> None: ... @@ -16,7 +15,6 @@ class HealthCheckRequest(message.Message, metaclass=MessageMeta): @final class HealthCheckResponse(message.Message, metaclass=MessageMeta): - __slots__ = () ServingStatus: Incomplete UNKNOWN: Incomplete SERVING: Incomplete diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi index 946222b61c55..94f335771385 100644 --- a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi @@ -10,7 +10,6 @@ DESCRIPTOR: FileDescriptor @final class ServerReflectionRequest(message.Message, metaclass=MessageMeta): - __slots__ = () HOST_FIELD_NUMBER: ClassVar[int] FILE_BY_FILENAME_FIELD_NUMBER: ClassVar[int] FILE_CONTAINING_SYMBOL_FIELD_NUMBER: ClassVar[int] @@ -36,7 +35,6 @@ class ServerReflectionRequest(message.Message, metaclass=MessageMeta): @final class ExtensionRequest(message.Message, metaclass=MessageMeta): - __slots__ = () CONTAINING_TYPE_FIELD_NUMBER: ClassVar[int] EXTENSION_NUMBER_FIELD_NUMBER: ClassVar[int] containing_type: str @@ -46,7 +44,6 @@ class ExtensionRequest(message.Message, metaclass=MessageMeta): @final class ServerReflectionResponse(message.Message, metaclass=MessageMeta): - __slots__ = () VALID_HOST_FIELD_NUMBER: ClassVar[int] ORIGINAL_REQUEST_FIELD_NUMBER: ClassVar[int] FILE_DESCRIPTOR_RESPONSE_FIELD_NUMBER: ClassVar[int] @@ -72,7 +69,6 @@ class ServerReflectionResponse(message.Message, metaclass=MessageMeta): @final class FileDescriptorResponse(message.Message, metaclass=MessageMeta): - __slots__ = () FILE_DESCRIPTOR_PROTO_FIELD_NUMBER: ClassVar[int] file_descriptor_proto: containers.RepeatedScalarFieldContainer[bytes] def __init__(self, file_descriptor_proto: Iterable[bytes] | None = ...) -> None: ... @@ -80,7 +76,6 @@ class FileDescriptorResponse(message.Message, metaclass=MessageMeta): @final class ExtensionNumberResponse(message.Message, metaclass=MessageMeta): - __slots__ = () BASE_TYPE_NAME_FIELD_NUMBER: ClassVar[int] EXTENSION_NUMBER_FIELD_NUMBER: ClassVar[int] base_type_name: str @@ -90,7 +85,6 @@ class ExtensionNumberResponse(message.Message, metaclass=MessageMeta): @final class ListServiceResponse(message.Message, metaclass=MessageMeta): - __slots__ = () SERVICE_FIELD_NUMBER: ClassVar[int] service: containers.RepeatedCompositeFieldContainer[ServiceResponse] def __init__(self, service: Iterable[ServiceResponse | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... @@ -98,7 +92,6 @@ class ListServiceResponse(message.Message, metaclass=MessageMeta): @final class ServiceResponse(message.Message, metaclass=MessageMeta): - __slots__ = () NAME_FIELD_NUMBER: ClassVar[int] name: str def __init__(self, name: str | None = ...) -> None: ... @@ -106,7 +99,6 @@ class ServiceResponse(message.Message, metaclass=MessageMeta): @final class ErrorResponse(message.Message, metaclass=MessageMeta): - __slots__ = () ERROR_CODE_FIELD_NUMBER: ClassVar[int] ERROR_MESSAGE_FIELD_NUMBER: ClassVar[int] error_code: int diff --git a/stubs/protobuf/google/protobuf/any_pb2.pyi b/stubs/protobuf/google/protobuf/any_pb2.pyi index 175f0c8cc9bf..c12c7e4a8133 100644 --- a/stubs/protobuf/google/protobuf/any_pb2.pyi +++ b/stubs/protobuf/google/protobuf/any_pb2.pyi @@ -130,8 +130,6 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t } """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor TYPE_URL_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/api_pb2.pyi b/stubs/protobuf/google/protobuf/api_pb2.pyi index 88a8f60b6f99..71e8ca47853f 100644 --- a/stubs/protobuf/google/protobuf/api_pb2.pyi +++ b/stubs/protobuf/google/protobuf/api_pb2.pyi @@ -57,8 +57,6 @@ class Api(google.protobuf.message.Message): detailed terminology. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -151,8 +149,6 @@ global___Api = Api class Method(google.protobuf.message.Message): """Method represents a method of an API interface.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -293,8 +289,6 @@ class Mixin(google.protobuf.message.Message): } """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi index ce1f34b4d5f8..a6f744c26074 100644 --- a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi +++ b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi @@ -37,8 +37,6 @@ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class Version(google.protobuf.message.Message): """The version number of protocol compiler.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor MAJOR_FIELD_NUMBER: builtins.int @@ -73,8 +71,6 @@ global___Version = Version class CodeGeneratorRequest(google.protobuf.message.Message): """An encoded CodeGeneratorRequest is written to the plugin's stdin.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor FILE_TO_GENERATE_FIELD_NUMBER: builtins.int @@ -163,8 +159,6 @@ global___CodeGeneratorRequest = CodeGeneratorRequest class CodeGeneratorResponse(google.protobuf.message.Message): """The plugin writes an encoded CodeGeneratorResponse to stdout.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Feature: @@ -190,8 +184,6 @@ class CodeGeneratorResponse(google.protobuf.message.Message): class File(google.protobuf.message.Message): """Represents a single generated file.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index 0a51e16bf28c..d3bc182e4be3 100644 --- a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -109,8 +109,6 @@ class FileDescriptorSet(google.protobuf.message.Message): files it parses. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor FILE_FIELD_NUMBER: builtins.int @@ -125,8 +123,6 @@ global___FileDescriptorSet = FileDescriptorSet class FileDescriptorProto(google.protobuf.message.Message): """Describes a complete .proto file.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -267,13 +263,10 @@ global___FileDescriptorProto = FileDescriptorProto class DescriptorProto(google.protobuf.message.Message): """Describes a message type.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class ExtensionRange(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor START_FIELD_NUMBER: builtins.int @@ -304,8 +297,6 @@ class DescriptorProto(google.protobuf.message.Message): not overlap. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor START_FIELD_NUMBER: builtins.int @@ -402,7 +393,6 @@ global___DescriptorProto = DescriptorProto @typing.final class ExtensionRangeOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _VerificationState: @@ -427,7 +417,6 @@ class ExtensionRangeOptions(google.protobuf.message.Message): @typing.final class Declaration(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor NUMBER_FIELD_NUMBER: builtins.int @@ -534,8 +523,6 @@ global___ExtensionRangeOptions = ExtensionRangeOptions class FieldDescriptorProto(google.protobuf.message.Message): """Describes a field within a message.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Type: @@ -796,8 +783,6 @@ global___FieldDescriptorProto = FieldDescriptorProto class OneofDescriptorProto(google.protobuf.message.Message): """Describes a oneof.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -815,8 +800,6 @@ global___OneofDescriptorProto = OneofDescriptorProto class EnumDescriptorProto(google.protobuf.message.Message): """Describes an enum type.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final @@ -829,8 +812,6 @@ class EnumDescriptorProto(google.protobuf.message.Message): domain. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor START_FIELD_NUMBER: builtins.int @@ -900,8 +881,6 @@ global___EnumDescriptorProto = EnumDescriptorProto class EnumValueDescriptorProto(google.protobuf.message.Message): """Describes a value within an enum.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -929,8 +908,6 @@ global___EnumValueDescriptorProto = EnumValueDescriptorProto class ServiceDescriptorProto(google.protobuf.message.Message): """Describes a service.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -957,8 +934,6 @@ global___ServiceDescriptorProto = ServiceDescriptorProto class MethodDescriptorProto(google.protobuf.message.Message): """Describes a method of a service.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -1058,8 +1033,6 @@ class FileOptions(google.protobuf.message.Message): to automatically assign option numbers. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor class _OptimizeMode: @@ -1348,7 +1321,6 @@ global___FileOptions = FileOptions @typing.final class MessageOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor MESSAGE_SET_WIRE_FORMAT_FIELD_NUMBER: builtins.int @@ -1490,7 +1462,6 @@ global___MessageOptions = MessageOptions @typing.final class FieldOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _CType: @@ -1606,7 +1577,6 @@ class FieldOptions(google.protobuf.message.Message): @typing.final class EditionDefault(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor EDITION_FIELD_NUMBER: builtins.int @@ -1622,8 +1592,6 @@ class FieldOptions(google.protobuf.message.Message): class FeatureSupport(google.protobuf.message.Message): """Information about the support window of a feature.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor EDITION_INTRODUCED_FIELD_NUMBER: builtins.int @@ -1877,7 +1845,6 @@ global___FieldOptions = FieldOptions @typing.final class OneofOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor FEATURES_FIELD_NUMBER: builtins.int @@ -1911,7 +1878,6 @@ global___OneofOptions = OneofOptions @typing.final class EnumOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor ALLOW_ALIAS_FIELD_NUMBER: builtins.int @@ -1993,7 +1959,6 @@ global___EnumOptions = EnumOptions @typing.final class EnumValueOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor DEPRECATED_FIELD_NUMBER: builtins.int @@ -2072,7 +2037,6 @@ global___EnumValueOptions = EnumValueOptions @typing.final class ServiceOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor FEATURES_FIELD_NUMBER: builtins.int @@ -2122,7 +2086,6 @@ global___ServiceOptions = ServiceOptions @typing.final class MethodOptions(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _IdempotencyLevel: @@ -2221,8 +2184,6 @@ class UninterpretedOption(google.protobuf.message.Message): in them. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final @@ -2234,8 +2195,6 @@ class UninterpretedOption(google.protobuf.message.Message): "foo.(bar.baz).moo". """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_PART_FIELD_NUMBER: builtins.int @@ -2331,8 +2290,6 @@ class FeatureSet(google.protobuf.message.Message): conflict here. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor class _FieldPresence: @@ -2530,8 +2487,6 @@ class FeatureSetDefaults(google.protobuf.message.Message): for the closest matching edition, followed by proto merges. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final @@ -2542,8 +2497,6 @@ class FeatureSetDefaults(google.protobuf.message.Message): be used. This field must be in strict ascending order by edition. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor EDITION_FIELD_NUMBER: builtins.int @@ -2623,13 +2576,10 @@ class SourceCodeInfo(google.protobuf.message.Message): FileDescriptorProto was generated. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class Location(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor PATH_FIELD_NUMBER: builtins.int @@ -2813,13 +2763,10 @@ class GeneratedCodeInfo(google.protobuf.message.Message): source file, but may contain references to different source .proto files. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class Annotation(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Semantic: diff --git a/stubs/protobuf/google/protobuf/duration_pb2.pyi b/stubs/protobuf/google/protobuf/duration_pb2.pyi index 67cd9b254692..2cb846889f4d 100644 --- a/stubs/protobuf/google/protobuf/duration_pb2.pyi +++ b/stubs/protobuf/google/protobuf/duration_pb2.pyi @@ -103,8 +103,6 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn microsecond should be expressed in JSON format as "3.000001s". """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor SECONDS_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/empty_pb2.pyi b/stubs/protobuf/google/protobuf/empty_pb2.pyi index d1490886870b..317979279540 100644 --- a/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -50,8 +50,6 @@ class Empty(google.protobuf.message.Message): } """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor def __init__(self) -> None: ... diff --git a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi index b8eb88bd271e..82dea7a11b56 100644 --- a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi +++ b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi @@ -246,8 +246,6 @@ class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_k `INVALID_ARGUMENT` error if any path is unmappable. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor PATHS_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/source_context_pb2.pyi b/stubs/protobuf/google/protobuf/source_context_pb2.pyi index 528b4d569fdc..9d74fb3d5926 100644 --- a/stubs/protobuf/google/protobuf/source_context_pb2.pyi +++ b/stubs/protobuf/google/protobuf/source_context_pb2.pyi @@ -46,8 +46,6 @@ class SourceContext(google.protobuf.message.Message): protobuf element, like the file in which it is defined. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor FILE_NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/struct_pb2.pyi b/stubs/protobuf/google/protobuf/struct_pb2.pyi index cbf96c0a3157..8e63dabfc2f1 100644 --- a/stubs/protobuf/google/protobuf/struct_pb2.pyi +++ b/stubs/protobuf/google/protobuf/struct_pb2.pyi @@ -82,13 +82,10 @@ class Struct(google.protobuf.message.Message, google.protobuf.internal.well_know The JSON representation for `Struct` is JSON object. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class FieldsEntry(google.protobuf.message.Message): - __slots__ = () DESCRIPTOR: google.protobuf.descriptor.Descriptor KEY_FIELD_NUMBER: builtins.int @@ -120,8 +117,6 @@ class Value(google.protobuf.message.Message): The JSON representation for `Value` is JSON value. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NULL_VALUE_FIELD_NUMBER: builtins.int @@ -207,8 +202,6 @@ class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_k The JSON representation for `ListValue` is JSON array. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUES_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi index 04f468f13607..52daff363ddf 100644 --- a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi +++ b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi @@ -134,8 +134,6 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k ) to obtain a formatter capable of generating timestamps in this format. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor SECONDS_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/type_pb2.pyi b/stubs/protobuf/google/protobuf/type_pb2.pyi index 804dd2f3363b..4d3fc1cb6577 100644 --- a/stubs/protobuf/google/protobuf/type_pb2.pyi +++ b/stubs/protobuf/google/protobuf/type_pb2.pyi @@ -79,8 +79,6 @@ global___Syntax = Syntax class Type(google.protobuf.message.Message): """A protocol buffer message type.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -150,8 +148,6 @@ global___Type = Type class Field(google.protobuf.message.Message): """A single field of a message type.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Kind: @@ -352,8 +348,6 @@ global___Field = Field class Enum(google.protobuf.message.Message): """Enum type definition.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -415,8 +409,6 @@ global___Enum = Enum class EnumValue(google.protobuf.message.Message): """Enum value definition.""" - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int @@ -447,8 +439,6 @@ class Option(google.protobuf.message.Message): enumeration, etc. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor NAME_FIELD_NUMBER: builtins.int diff --git a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi index 2bded1d92877..b3d875bccf67 100644 --- a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi +++ b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi @@ -67,8 +67,6 @@ class DoubleValue(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -89,8 +87,6 @@ class FloatValue(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -111,8 +107,6 @@ class Int64Value(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -133,8 +127,6 @@ class UInt64Value(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -155,8 +147,6 @@ class Int32Value(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -177,8 +167,6 @@ class UInt32Value(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -199,8 +187,6 @@ class BoolValue(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -221,8 +207,6 @@ class StringValue(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int @@ -243,8 +227,6 @@ class BytesValue(google.protobuf.message.Message): has no plan to be removed. """ - __slots__ = () - DESCRIPTOR: google.protobuf.descriptor.Descriptor VALUE_FIELD_NUMBER: builtins.int From 815d66f41272af8bf8fc25ae8548c9ed0806dc97 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 21 Aug 2025 14:33:31 -0700 Subject: [PATCH 7/7] . --- stubs/protobuf/google/protobuf/internal/well_known_types.pyi | 4 ++-- stubs/protobuf/google/protobuf/message.pyi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi index 6950e5431777..69649998db4f 100644 --- a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +++ b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi @@ -67,7 +67,7 @@ _StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | float _StructValueArg: TypeAlias = _StructValue | Mapping[str, _StructValueArg] | Sequence[_StructValueArg] class Struct: - __slots__ = () + __slots__: tuple[()] = () def __getitem__(self, key: str) -> _StructValue: ... def __setitem__(self, key: str, value: _StructValueArg) -> None: ... def __delitem__(self, key: str) -> None: ... @@ -81,7 +81,7 @@ class Struct: def update(self, dictionary: SupportsItems[str, _StructValueArg]) -> None: ... class ListValue: - __slots__ = () + __slots__: tuple[()] = () def __len__(self) -> int: ... def append(self, value: _StructValue) -> None: ... def extend(self, elem_seq: Iterable[_StructValue]) -> None: ... diff --git a/stubs/protobuf/google/protobuf/message.pyi b/stubs/protobuf/google/protobuf/message.pyi index 660ffd47c766..73eb6b411e41 100644 --- a/stubs/protobuf/google/protobuf/message.pyi +++ b/stubs/protobuf/google/protobuf/message.pyi @@ -12,7 +12,7 @@ class DecodeError(Error): ... class EncodeError(Error): ... class Message: - __slots__ = () + __slots__: tuple[()] = () DESCRIPTOR: Descriptor | _upb_Descriptor def __deepcopy__(self, memo: Any = None) -> Self: ... def __eq__(self, other_msg): ...