Skip to content

Commit 690c8bb

Browse files
committed
🎨 ruff format
1 parent c4b6ce0 commit 690c8bb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎docs/user/differences.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ from typing import TypeVar
5353

5454
NT = TypeVar("NT", bound=npt.NBitBase)
5555

56+
5657
def f(x: np.floating[NT]) -> np.floating[NT]: ...
5758
```
5859

@@ -68,6 +69,7 @@ def f(x: np.floating[NT]) -> np.floating[NT]: ...
6869
import numpy as np
6970
import numpy.typing as npt
7071

72+
7173
def f[NT: npt.NBitBase](x: np.floating[NT]) -> np.floating[NT]: ...
7274
```
7375

@@ -87,6 +89,7 @@ from typing import TypeVar
8789

8890
FloatT = TypeVar("FloatT", bound=np.floating)
8991

92+
9093
def f(x: FloatT) -> FloatT: ...
9194
```
9295

@@ -101,6 +104,7 @@ def f(x: FloatT) -> FloatT: ...
101104
```py
102105
import numpy as np
103106

107+
104108
def f[FloatT: np.floating](x: FloatT) -> FloatT: ...
105109
```
106110

@@ -123,6 +127,7 @@ from typing import TypeVar
123127

124128
NT = TypeVar("NT", bound=npt.NBitBase)
125129

130+
126131
def f(x: np.complexfloating[NT]) -> np.floating[NT]: ...
127132
```
128133

@@ -136,6 +141,7 @@ def f(x: np.complexfloating[NT]) -> np.floating[NT]: ...
136141
import numpy as np
137142
import numpy.typing as npt
138143

144+
139145
def f[NT: npt.NBitBase](x: np.complexfloating[NT]) -> np.floating[NT]: ...
140146
```
141147

@@ -150,6 +156,7 @@ In that case, you can rewrite it by using
150156
import numpy as np
151157
from typing import overload
152158

159+
153160
@overload
154161
def f(x: np.complex64) -> np.float32: ...
155162
@overload
@@ -205,9 +212,11 @@ the following type-unsafe code:
205212
```py
206213
import numpy as np
207214

215+
208216
def half(a: np.number) -> np.number:
209217
return a // 2
210218

219+
211220
half(np.complex128(1j)) # accepted
212221
```
213222

0 commit comments

Comments
 (0)