File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,6 +240,6 @@ def absolute(self, a):
240240 return self .abs (a )
241241
242242 def vdot (self , a : Array , b : Array ):
243-
244243 return rec_multimap_array_container (pt .vdot , a , b )
244+
245245 # }}}
Original file line number Diff line number Diff line change 2727THE SOFTWARE.
2828"""
2929import logging
30- from typing import cast
30+ from typing import Optional , Tuple , cast # noqa: UP035
3131
3232import numpy as np
3333import pytest
@@ -63,7 +63,7 @@ def test_dataclass_array_container() -> None:
6363 class ArrayContainerWithOptional :
6464 x : np .ndarray
6565 # Deliberately left as Optional to test compatibility.
66- y : np .ndarray | None
66+ y : Optional [ np .ndarray ] # noqa: UP045
6767
6868 with pytest .raises (TypeError , match = "Field 'y' union contains non-array" ):
6969 # NOTE: cannot have wrapped annotations (here by `Optional`)
@@ -76,7 +76,8 @@ class ArrayContainerWithOptional:
7676 @dataclass
7777 class ArrayContainerWithTuple :
7878 x : Array
79- y : tuple [Array , Array ]
79+ # Deliberately left as Tuple to test compatibility.
80+ y : Tuple [Array , Array ] # noqa: UP006
8081
8182 with pytest .raises (TypeError , match = "Typing annotation not supported on field 'y'" ):
8283 dataclass_array_container (ArrayContainerWithTuple )
You can’t perform that action at this time.
0 commit comments