py/obj: Add support for __float__ and __complex__ functions.
This commit is contained in:
committed by
Damien George
parent
fa15aed0f7
commit
1e87b56219
@@ -378,6 +378,12 @@ const byte mp_unary_op_method_name[MP_UNARY_OP_NUM_RUNTIME] = {
|
||||
[MP_UNARY_OP_INVERT] = MP_QSTR___invert__,
|
||||
[MP_UNARY_OP_ABS] = MP_QSTR___abs__,
|
||||
#endif
|
||||
#if MICROPY_PY_BUILTINS_FLOAT
|
||||
[MP_UNARY_OP_FLOAT_MAYBE] = MP_QSTR___float__,
|
||||
#if MICROPY_PY_BUILTINS_COMPLEX
|
||||
[MP_UNARY_OP_COMPLEX_MAYBE] = MP_QSTR___complex__,
|
||||
#endif
|
||||
#endif
|
||||
#if MICROPY_PY_SYS_GETSIZEOF
|
||||
[MP_UNARY_OP_SIZEOF] = MP_QSTR___sizeof__,
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user