File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -133,9 +133,11 @@ version_tuple = {version_tuple!r}
133133 " D107" , # Missing docstring in __init__
134134 " D203" , # 1 blank line required before class docstring
135135 " D213" , # Multi-line docstring summary should start at the second line
136+ " D401" , # First line of docstring should be in imperative mood
136137 " FBT" , # flake8-boolean-trap
137138 " FIX" , # flake8-fixme
138139 " ISC001" , # Conflicts with formatter
140+ " PLW1641" , # Object does not implement `__hash__` method
139141 ]
140142
141143 [tool .ruff .lint .per-file-ignores ]
Original file line number Diff line number Diff line change 1+ __all__ = [
2+ "DType" ,
3+ ]
4+
5+ from typing import Protocol , type_check_only
6+
7+
8+ @type_check_only
9+ class DType (Protocol ):
10+ """Protocol for classes that represent a data type.
11+
12+ This `typing.Protocol` is `typing.type_check_only` and cannot be used at
13+ runtime. This limitation is intentional since the array API structurally
14+ defines a ``dtype`` object as anything with an ``__eq__`` method that
15+ compares to another ``dtype`` object. This broad definition means that most
16+ Python objects will satisfy this protocol and can be erroneously considered
17+ a ``dtype``.
18+
19+ """
20+
21+ def __eq__ (self , other : object , / ) -> bool :
22+ """Computes the truth value of ``self == other`` in order to test for data type object equality.""" # noqa: E501
23+ ...
You can’t perform that action at this time.
0 commit comments