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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:c:func:`PyNumber_Float` doesn't fallback anymore to
``PyFloat_FromDouble(PyFloat_AS_DOUBLE(obj))`` if a :class:`float` subtype resets
:c:member:`~PyNumberMethods.nb_float` to ``NULL``. A :exc:`TypeError`
exception is raised instead.
4 changes: 0 additions & 4 deletions Objects/abstract.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,10 +1638,6 @@ PyNumber_Float(PyObject *o)
return PyFloat_FromDouble(val);
}

/* A float subclass with nb_float == NULL */
if (PyFloat_Check(o)) {
return PyFloat_FromDouble(PyFloat_AS_DOUBLE(o));
}
return PyFloat_FromString(o);
}

Expand Down
Loading