mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 05:22:23 +08:00
Make inheritance and metaclass of ctypes better match reality (#12982)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from _ctypes import _CArgObject, _CField
|
||||
from ctypes import (
|
||||
Array,
|
||||
Structure,
|
||||
_CField,
|
||||
_Pointer,
|
||||
_SimpleCData,
|
||||
c_byte,
|
||||
@@ -21,8 +21,8 @@ from ctypes import (
|
||||
c_wchar,
|
||||
c_wchar_p,
|
||||
)
|
||||
from typing import TypeVar
|
||||
from typing_extensions import TypeAlias
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
BYTE = c_byte
|
||||
WORD = c_ushort
|
||||
@@ -241,10 +241,16 @@ LPBYTE = PBYTE
|
||||
PBOOLEAN = PBYTE
|
||||
|
||||
# LP_c_char
|
||||
class PCHAR(_Pointer[CHAR]): ...
|
||||
class PCHAR(_Pointer[CHAR]):
|
||||
# this is inherited from ctypes.c_char_p, kind of.
|
||||
@classmethod
|
||||
def from_param(cls, value: Any, /) -> Self | _CArgObject: ...
|
||||
|
||||
# LP_c_wchar
|
||||
class PWCHAR(_Pointer[WCHAR]): ...
|
||||
class PWCHAR(_Pointer[WCHAR]):
|
||||
# inherited from ctypes.c_wchar_p, kind of
|
||||
@classmethod
|
||||
def from_param(cls, value: Any, /) -> Self | _CArgObject: ...
|
||||
|
||||
# LP_c_void_p
|
||||
class PHANDLE(_Pointer[HANDLE]): ...
|
||||
|
||||
Reference in New Issue
Block a user