File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-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__  =  ("DType" ,)
2+ 
3+ from  typing  import  Protocol , type_check_only 
4+ 
5+ 
6+ @type_check_only  
7+ class  DType (Protocol ):
8+     """Protocol for classes that represent a data type. 
9+ 
10+     This `typing.Protocol` is `typing.type_check_only` and cannot be used at 
11+     runtime.  This limitation is intentional since the array API structurally 
12+     defines a ``dtype`` object as anything with an ``__eq__`` method that 
13+     compares to another ``dtype`` object. This broad definition means that most 
14+     Python objects will satisfy this protocol and can be erroneously considered 
15+     a ``dtype``. 
16+ 
17+     """ 
18+ 
19+     def  __eq__ (self , other : object , / ) ->  bool :
20+         """Computes the truth value of ``self == other`` in order to test for data type object equality."""   # noqa: E501 
21+         ...
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments