Why `_types.finfo_object` and `_types.iinfo_object`, `_array_object._array` does not inherit `Protocol` ?
还没有人认领这个 Issue。
评估
调研方向
阅读 src/array_api_stubs/_draft/_types.py 的第 60–79 行和 src/array_api_stubs/_draft/array_object.py 的第 19–20 行,然后将这些声明与 issue 中关于 Protocol 和 dataclass 的问题进行比较。该 issue 没有指定具体的更改或验收标准,因此完成此项工作需要 maintainer 就预期的类型设计作出明确决定。
由索引模型根据 Issue 内容生成。
描述
↓
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 = TypeVar("array", bound="_array")
class _array(Protocol[Device, Dtype, PyCapsule, array])
def __add__(self, other: Union[int, float, array], /) -> array:
- 主要语言
- Python
- 星标
- 281
- 派生
- 52
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
data-apis/array-api 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 5/5 一周以上 新手友好度 35/100
-
Maintenance
-
难度 5/5 一周以上 新手友好度 25/100
查看 data-apis/array-api 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 74/100