Open
Description
array-api/src/array_api_stubs/_draft/_types.py
Lines 60 to 79 in 6d205d7
↓
class finfo_object(Protocol[dtype]):
"""Dataclass returned by `finfo`."""
bits: int
eps: float
max: float
min: float
smallest_normal: float
dtype: dtype
class iinfo_object(Protocol[dtype]):
"""Dataclass returned by `iinfo`."""
bits: int
max: int
min: int
dtype: dtype
I wonder why they are defined as dataclass
array-api/src/array_api_stubs/_draft/array_object.py
Lines 19 to 20 in 6d205d7
↓
array = TypeVar("array", bound="_array")
class _array(Protocol[Device, Dtype, PyCapsule, array])
def __add__(self, other: Union[int, float, array], /) -> array:
Activity
[-]Why `_types.finfo_object` and `_types.iinfo_object` does not inherit `Protocol[dtype]` ?[/-][+]Why `_types.finfo_object` and `_types.iinfo_object`, `_array_object._array` does not inherit `Protocol` ?[/+]finfo_object
,iinfo_object
,_array
to typing.Protocol #857