Damien George
bdbe8c9ae2
py: Make UNARY_OP_NOT a first-class op, to agree with Py not semantics.
...
Fixes #1684 and makes "not" match Python semantics. The code is also
simplified (the separate MP_BC_NOT opcode is removed) and the patch saves
68 bytes for bare-arm/ and 52 bytes for minimal/.
Previously "not x" was implemented as !mp_unary_op(x, MP_UNARY_OP_BOOL),
so any given object only needs to implement MP_UNARY_OP_BOOL (and the VM
had a special opcode to do the ! bit).
With this patch "not x" is implemented as mp_unary_op(x, MP_UNARY_OP_NOT),
but this operation is caught at the start of mp_unary_op and dispatched as
!mp_obj_is_true(x). mp_obj_is_true has special logic to test for
truthness, and is the correct way to handle the not operation.
2015-12-10 22:19:48 +00:00
..
2015-09-03 23:14:06 +01:00
2015-11-09 14:11:21 +00:00
2015-10-19 14:26:19 +01:00
2015-10-13 00:50:17 +01:00
2015-10-13 00:50:17 +01:00
2015-11-27 14:06:53 +00:00
2015-12-10 22:19:48 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-25 13:19:36 +02:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-12-08 21:05:14 +00:00
2015-11-20 12:30:37 +00:00
2015-11-29 14:25:04 +00:00
2015-12-10 22:19:48 +00:00
2015-11-29 14:25:35 +00:00
2015-11-20 12:44:20 +00:00
2015-12-10 17:32:54 +00:00
2015-12-10 22:19:48 +00:00
2015-11-22 20:05:08 +02:00
2015-12-03 01:40:52 +02:00
2015-11-29 14:25:04 +00:00
2015-11-23 16:50:42 +00:00
2015-09-07 17:33:44 +01:00
2015-10-11 11:09:57 +03:00
2015-10-30 11:34:53 +03:00
2015-11-20 14:09:20 +00:00
2015-12-08 02:23:58 +02:00
2015-10-12 15:32:06 +03:00
2015-12-10 00:49:25 +02:00
2015-11-29 14:25:04 +00:00
2015-12-07 18:56:25 +02:00
2015-12-07 00:19:24 +02:00
2015-11-29 14:25:04 +00:00
2015-11-29 14:25:04 +00:00
2015-11-29 14:25:04 +00:00
2015-11-29 14:25:04 +00:00
2015-11-29 14:25:04 +00:00
2015-11-29 14:25:35 +00:00
2015-12-05 00:27:04 +02:00
2015-12-07 18:56:25 +02:00
2015-10-31 19:14:30 +03:00
2015-12-02 14:21:36 +02:00
2015-11-29 14:25:04 +00:00
2015-12-05 00:13:29 +02:00
2015-11-22 22:03:18 +02:00
2015-11-24 17:34:14 +02:00
2015-10-11 15:18:15 +03:00
2015-11-29 14:25:35 +00:00
2015-10-20 13:26:34 +01:00
2015-11-24 17:34:14 +02:00
2015-11-24 17:34:14 +02:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:36 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-12-10 22:19:48 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:36 +00:00
2015-11-29 14:25:35 +00:00
2015-11-13 12:49:18 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-09 01:34:56 +02:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-12-07 00:19:24 +02:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:04 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:36 +00:00
2015-11-29 14:25:35 +00:00
2015-11-29 14:25:35 +00:00
2015-11-25 13:19:36 +02:00
2015-11-29 14:25:04 +00:00
2015-11-29 14:25:04 +00:00
2015-12-07 18:56:25 +02:00
2015-11-29 14:25:35 +00:00
2015-12-10 22:19:48 +00:00
2015-12-10 22:19:48 +00:00
2015-11-29 14:25:35 +00:00
2015-11-13 12:49:18 +00:00
2015-11-29 14:25:35 +00:00
2015-12-10 22:19:48 +00:00
2015-11-29 14:25:36 +00:00
2015-12-09 18:47:43 +00:00
2015-12-09 18:47:43 +00:00
2015-12-10 22:19:48 +00:00
2015-12-10 22:19:48 +00:00