Skip to content

Why _types.finfo_object and _types.iinfo_object, _array_object._array does not inherit Protocol ? #856

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy