8000 Why `_types.finfo_object` and `_types.iinfo_object`, `_array_object._array` does not inherit `Protocol` ? · Issue #856 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content
Why _types.finfo_object and _types.iinfo_object, _array_object._array does not inherit Protocol ? #856
Open
@34j

Description

@34j

@dataclass
class finfo_object:
"""Dataclass returned by `finfo`."""
bits: int
eps: float
max: float
min: float
smallest_normal: float
dtype: dtype
@dataclass
class iinfo_object:
"""Dataclass returned by `iinfo`."""
bits: int
max: int
min: int
dtype: dtype

 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

class _array:
def __init__(self: array) -> None:

array = TypeVar("array", bound="_array")

class _array(Protocol[Device, Dtype, PyCapsule, array])
	def __add__(self, other: Union[int, float, array], /) -> array:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0