diff options
| author | Damien George <damien@micropython.org> | 2023-05-25 10:57:08 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-06-01 13:01:07 +1000 |
| commit | 48ffd6596e7a4c185a81be233b46d3c99a83a7ac (patch) | |
| tree | 3a15993f388746d0125b875c621a8508b5c8b731 /py/runtime0.h | |
| parent | 3ae78e803b69c4f1fd5dfe7eb732de7075f12e6c (diff) | |
py: Change MP_UNARY_OP_INT to MP_UNARY_OP_INT_MAYBE.
To be consistent with MP_UNARY_OP_INT_FLOAT and MP_UNARY_OP_INT_COMPLEX,
and allow int() to first check if a type supports __int__ before trying
other things (as per CPython).
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/runtime0.h')
| -rw-r--r-- | py/runtime0.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/runtime0.h b/py/runtime0.h index c82a4717f..6ef2d727c 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -75,7 +75,7 @@ typedef enum { MP_UNARY_OP_LEN, // __len__ MP_UNARY_OP_HASH, // __hash__; must return a small int MP_UNARY_OP_ABS, // __abs__ - MP_UNARY_OP_INT, // __int__ + MP_UNARY_OP_INT_MAYBE, // __int__; must return MP_OBJ_NULL, or an object satisfying mp_obj_is_int() MP_UNARY_OP_FLOAT_MAYBE, // __float__ MP_UNARY_OP_COMPLEX_MAYBE, // __complex__ MP_UNARY_OP_SIZEOF, // for sys.getsizeof() |
