Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tensor-shapes/pyrefly-numpy-stubs/numpy-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,13 @@ class bool_(generic):

class float16(floating): ...
class float32(floating): ...
class float64(floating): ...

class float64(floating):
@overload
def __sub__(self, other: float, /) -> float64: ...
@overload
def __sub__(self, other: _NumberScalar, /) -> number: ...

class longdouble(floating): ...
class complex64(complexfloating): ...
class complex128(complexfloating): ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def test_numeric_scalar_operations() -> None:
assert_type(float(real), float)
assert_type(complex(complex_), complex)
assert_shape((real**2).shape, ())
assert_type(real - 1.0, np.float64)
assert_shape((real * 1j).shape, ())
assert_type(1j * real, np.number | complex)
assert_shape((complex_ / integer).shape, ())
Expand Down
Loading