mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-07 05:54:02 +08:00
Add @type_check_only to stub-only private classes in stdlib, round 2 (#15515)
This commit is contained in:
@@ -57,6 +57,7 @@ _VsapiStatespec: TypeAlias = tuple[Unpack[tuple[str, ...]], int]
|
||||
_P = ParamSpec("_P")
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@type_check_only
|
||||
class _Layout(TypedDict, total=False):
|
||||
side: Literal["left", "right", "top", "bottom"]
|
||||
sticky: str # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty
|
||||
@@ -68,6 +69,7 @@ class _Layout(TypedDict, total=False):
|
||||
_LayoutSpec: TypeAlias = list[tuple[str, _Layout | None]]
|
||||
|
||||
# Keep these in sync with the appropriate methods in Style
|
||||
@type_check_only
|
||||
class _ElementCreateImageKwargs(TypedDict, total=False):
|
||||
border: _Padding
|
||||
height: float | str
|
||||
@@ -82,12 +84,15 @@ _ElementCreateArgsCrossPlatform: TypeAlias = (
|
||||
| tuple[Literal["from"], str] # (fromelement is optional)
|
||||
)
|
||||
if sys.platform == "win32" and sys.version_info >= (3, 13):
|
||||
@type_check_only
|
||||
class _ElementCreateVsapiKwargsPadding(TypedDict, total=False):
|
||||
padding: _Padding
|
||||
|
||||
@type_check_only
|
||||
class _ElementCreateVsapiKwargsMargin(TypedDict, total=False):
|
||||
padding: _Padding
|
||||
|
||||
@type_check_only
|
||||
class _ElementCreateVsapiKwargsSize(TypedDict):
|
||||
width: float | str
|
||||
height: float | str
|
||||
|
||||
Reference in New Issue
Block a user