[pywin32] Mark stub-only NamedTuples as @type_check_only (#15514)

This commit is contained in:
Semyon Moroz
2026-03-15 23:43:09 +04:00
committed by GitHub
parent 466f4f2744
commit eca2ee5e33
+13 -12
View File
@@ -1,16 +1,17 @@
from _typeshed import Incomplete, ReadableBuffer
from array import array
from typing import NamedTuple
from typing import NamedTuple, type_check_only
is64bit: bool
@type_check_only
class _WMNOTIFY(NamedTuple):
hwndFrom: Incomplete
idFrom: Incomplete
code: Incomplete
def UnpackWMNOTIFY(lparam: int) -> _WMNOTIFY: ...
@type_check_only
class _NMITEMACTIVATE(NamedTuple):
hwndFrom: Incomplete
idFrom: Incomplete
@@ -37,7 +38,7 @@ def PackMENUITEMINFO(
hbmpItem: Incomplete | None = ...,
dwTypeData: Incomplete | None = ...,
) -> tuple[array[int], list[Incomplete]]: ...
@type_check_only
class _MENUITEMINFO(NamedTuple):
fType: int | None
fState: int | None
@@ -59,7 +60,7 @@ def PackMENUINFO(
dwMenuData: Incomplete | None = ...,
fMask: int = ...,
) -> array[int]: ...
@type_check_only
class _MENUINFO(NamedTuple):
dwStyle: Incomplete | None
cyMax: Incomplete | None
@@ -72,7 +73,7 @@ def EmptyMENUINFO(mask: Incomplete | None = ...) -> array[int]: ...
def PackTVINSERTSTRUCT(parent, insertAfter, tvitem) -> tuple[bytes, list[Incomplete]]: ...
def PackTVITEM(hitem, state, stateMask, text, image, selimage, citems, param) -> tuple[array[int], list[Incomplete]]: ...
def EmptyTVITEM(hitem, mask: Incomplete | None = ..., text_buf_size: int = ...) -> tuple[array[int], list[Incomplete]]: ...
@type_check_only
class _TVITEM(NamedTuple):
item_hItem: Incomplete
item_state: Incomplete | None
@@ -84,7 +85,7 @@ class _TVITEM(NamedTuple):
item_param: Incomplete | None
def UnpackTVITEM(buffer: ReadableBuffer) -> _TVITEM: ...
@type_check_only
class _TVNOTIFY(NamedTuple):
hwndFrom: Incomplete
id: Incomplete
@@ -94,7 +95,7 @@ class _TVNOTIFY(NamedTuple):
item_new: _TVITEM
def UnpackTVNOTIFY(lparam: int) -> _TVNOTIFY: ...
@type_check_only
class _TVDISPINFO(NamedTuple):
hwndFrom: Incomplete
id: Incomplete
@@ -112,7 +113,7 @@ def PackLVITEM(
param: Incomplete | None = ...,
indent: Incomplete | None = ...,
) -> tuple[array[int], list[Incomplete]]: ...
@type_check_only
class _LVITEM(NamedTuple):
item_item: Incomplete
item_subItem: Incomplete
@@ -124,7 +125,7 @@ class _LVITEM(NamedTuple):
item_indent: Incomplete | None
def UnpackLVITEM(buffer: ReadableBuffer) -> _LVITEM: ...
@type_check_only
class _LVDISPINFO(NamedTuple):
hwndFrom: Incomplete
id: Incomplete
@@ -132,7 +133,7 @@ class _LVDISPINFO(NamedTuple):
item: _LVITEM
def UnpackLVDISPINFO(lparam: int) -> _LVDISPINFO: ...
@type_check_only
class _UnpackLVNOTIFY(NamedTuple):
hwndFrom: Incomplete
id: Incomplete
@@ -157,7 +158,7 @@ def PackLVCOLUMN(
image: Incomplete | None = ...,
order: Incomplete | None = ...,
) -> tuple[array[int], list[Incomplete]]: ...
@type_check_only
class _LVCOLUMN(NamedTuple):
fmt: Incomplete | None
cx: Incomplete | None
@@ -169,7 +170,7 @@ class _LVCOLUMN(NamedTuple):
def UnpackLVCOLUMN(lparam: ReadableBuffer) -> _LVCOLUMN: ...
def EmptyLVCOLUMN(mask: Incomplete | None = ..., text_buf_size: int = ...) -> tuple[array[int], list[Incomplete]]: ...
def PackLVHITTEST(pt) -> tuple[array[int], None]: ...
@type_check_only
class _LVHITTEST(NamedTuple):
pt: tuple[Incomplete, Incomplete]
flags: Incomplete