Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/numpy/numpy
/ __float__
Method
__float__
numpy/core/tests/test_regression.py:1022–1023 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
1020
# Ticket 702
1021
class
MyFloat:
1022
def
__float__(self):
1023
return
1.0
1024
1025
tmp = np.atleast_1d([MyFloat()])
1026
tmp.astype(float)
# Should succeed
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected