- 
                Notifications
    
You must be signed in to change notification settings  - Fork 52
 
Open
Labels
topic: Static TypingStatic typing.Static typing.
Description
array-api/src/array_api_stubs/_draft/_types.py
Lines 60 to 79 in 6d205d7
| @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
array-api/src/array_api_stubs/_draft/array_object.py
Lines 19 to 20 in 6d205d7
| 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
Labels
topic: Static TypingStatic typing.Static typing.
Type
Projects
Milestone
Relationships
Development
Select code repository
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,_arrayto typing.Protocol #857