Skip to content

Commit 559b529

Browse files
committed
update ctypes.CField
1 parent e19edce commit 559b529

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

stdlib/_ctypes.pyi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,18 @@ class CFuncPtr(_PointerLike, _CData, metaclass=_PyCFuncPtrType):
195195
_GetT = TypeVar("_GetT")
196196
_SetT = TypeVar("_SetT")
197197

198-
# This class is not exposed. It calls itself _ctypes.CField.
199198
@final
200-
@type_check_only
201199
class _CField(Generic[_CT, _GetT, _SetT]):
200+
name: str
201+
type: type[_CT]
202202
offset: int
203+
byte_offset: int
204+
byte_size: int
203205
size: int
206+
is_bitfield: bool
207+
bit_offset: int
208+
bit_size: int
209+
is_anonymous: bool
204210
if sys.version_info >= (3, 10):
205211
@overload
206212
def __get__(self, instance: None, owner: type[Any] | None = None, /) -> Self: ...

stdlib/ctypes/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ from _ctypes import (
1010
_CArgObject as _CArgObject,
1111
_CData as _CData,
1212
_CDataType as _CDataType,
13-
_CField as _CField,
13+
_CField as CField,
1414
_CTypeBaseType,
1515
_Pointer as _Pointer,
1616
_PointerLike as _PointerLike,

0 commit comments

Comments
 (0)