Skip to content
Snippets Groups Projects
Commit 9950865c authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py/objfloat: Fix binary ops with incompatible objects.

These are now returned as "operation not supported" instead of raising
TypeError. In particular, this fixes equality for float vs incompatible
types, which now properly results in False instead of exception. This
also paves the road to support reverse operation (e.g. __radd__) with
float objects.

This is achieved by introducing mp_obj_get_float_maybe(), similar to
existing mp_obj_get_int_maybe().
parent dd376a23
Branches
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment