File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
numpy/typing/tests/data/pass Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- from typing import Any , Optional
3
+ from typing import Any
4
4
import numpy as np
5
5
import pytest
6
6
26
26
27
27
28
28
class Object :
29
- def __array__ (self , dtype : Optional [ np .typing .DTypeLike ] = None ,
30
- copy : Optional [ bool ] = None ) -> np .ndarray [Any , np .dtype [np .object_ ]]:
29
+ def __array__ (self , dtype : np .typing .DTypeLike = None ,
30
+ copy : bool | None = None ) -> np .ndarray [Any , np .dtype [np .object_ ]]:
31
31
ret = np .empty ((), dtype = object )
32
32
ret [()] = self
33
33
return ret
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
- from typing import Any , Optional
2
+ from typing import Any
3
3
import numpy as np
4
4
5
5
@@ -13,8 +13,8 @@ def __floor__(self) -> Object:
13
13
def __ge__ (self , value : object ) -> bool :
14
14
return True
15
15
16
- def __array__ (self , dtype : Optional [ np .typing .DTypeLike ] = None ,
17
- copy : Optional [ bool ] = None ) -> np .ndarray [Any , np .dtype [np .object_ ]]:
16
+ def __array__ (self , dtype : np .typing .DTypeLike | None = None ,
17
+ copy : bool | None = None ) -> np .ndarray [Any , np .dtype [np .object_ ]]:
18
18
ret = np .empty ((), dtype = object )
19
19
ret [()] = self
20
20
return ret
You can’t perform that action at this time.
0 commit comments