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
@@ -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: ...
@@ -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
+17
View File
@@ -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
+1
View File
@@ -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