mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Add broad definition for c_bool constructor (#14841)
This commit is contained in:
@@ -142,6 +142,9 @@ class SupportsIter(Protocol[_T_co]):
|
||||
class SupportsAiter(Protocol[_T_co]):
|
||||
def __aiter__(self) -> _T_co: ...
|
||||
|
||||
class SupportsLen(Protocol):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
class SupportsLenAndGetItem(Protocol[_T_co]):
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, k: int, /) -> _T_co: ...
|
||||
|
||||
@@ -23,7 +23,7 @@ from _ctypes import (
|
||||
set_errno as set_errno,
|
||||
sizeof as sizeof,
|
||||
)
|
||||
from _typeshed import StrPath
|
||||
from _typeshed import StrPath, SupportsBool, SupportsLen
|
||||
from ctypes._endian import BigEndianStructure as BigEndianStructure, LittleEndianStructure as LittleEndianStructure
|
||||
from types import GenericAlias
|
||||
from typing import Any, ClassVar, Final, Generic, Literal, TypeVar, overload, type_check_only
|
||||
@@ -217,7 +217,7 @@ class py_object(_CanCastTo, _SimpleCData[_T]):
|
||||
|
||||
class c_bool(_SimpleCData[bool]):
|
||||
_type_: ClassVar[Literal["?"]]
|
||||
def __init__(self, value: bool = ...) -> None: ...
|
||||
def __init__(self, value: SupportsBool | SupportsLen | None = ...) -> None: ...
|
||||
|
||||
class c_byte(_SimpleCData[int]):
|
||||
_type_: ClassVar[Literal["b"]]
|
||||
|
||||
Reference in New Issue
Block a user