Add __slots__ to third-party packages using stubdefaulter (#14619)

This commit is contained in:
Jelle Zijlstra
2025-08-21 15:38:13 -07:00
committed by GitHub
parent 573b57d8da
commit ca44e4c45d
135 changed files with 675 additions and 25 deletions
+2
View File
@@ -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
@@ -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
@@ -30,6 +30,7 @@ class Tokenizer:
def render(self): ...
class Token:
__slots__ = ["value", "type", "subtype"]
LITERAL: Final = "LITERAL"
OPERAND: Final = "OPERAND"
FUNC: Final = "FUNC"
@@ -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]
+1
View File
@@ -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: ...
@@ -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