Move Structure and Union from ctypes/__init__.pyi to _ctypes.pyi (#10125)

This commit is contained in:
Jun Komoda
2023-05-01 21:01:41 +09:00
committed by GitHub
parent ae0c9f9dad
commit 295a5c3e7a
3 changed files with 24 additions and 21 deletions

View File

@@ -3,9 +3,14 @@ from _ctypes import (
RTLD_GLOBAL as RTLD_GLOBAL,
RTLD_LOCAL as RTLD_LOCAL,
Array as Array,
Structure as Structure,
Union as Union,
_CData as _CData,
_CDataMeta as _CDataMeta,
_CField as _CField,
_SimpleCData as _SimpleCData,
_StructUnionBase as _StructUnionBase,
_StructUnionMeta as _StructUnionMeta,
)
from collections.abc import Callable, Sequence
from typing import Any, ClassVar, Generic, TypeVar, overload
@@ -216,23 +221,5 @@ if sys.platform == "win32":
class HRESULT(_SimpleCData[int]): ... # TODO undocumented
class py_object(_CanCastTo, _SimpleCData[_T]): ...
class _CField:
offset: int
size: int
class _StructUnionMeta(_CDataMeta):
_fields_: Sequence[tuple[str, type[_CData]] | tuple[str, type[_CData], int]]
_pack_: int
_anonymous_: Sequence[str]
def __getattr__(self, name: str) -> _CField: ...
class _StructUnionBase(_CData, metaclass=_StructUnionMeta):
def __init__(self, *args: Any, **kw: Any) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
class Union(_StructUnionBase): ...
class Structure(_StructUnionBase): ...
class BigEndianStructure(Structure): ...
class LittleEndianStructure(Structure): ...