diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-30 01:29:32 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-30 01:29:32 -0800 |
commit | b25711ea8fdc1588b5a69f7d0941de09b50fa28c (patch) | |
tree | db7cd93c99583a858ef94b3dab95b882832da251 /py/runtime0.h | |
parent | cdd2c62e07549e36dba00bc37d7ba7a4cd41ad50 (diff) | |
parent | c1d9bbc3453454aceb28f51e72e4aeb8ef1c12eb (diff) | |
download | micropython-b25711ea8fdc1588b5a69f7d0941de09b50fa28c.tar.gz micropython-b25711ea8fdc1588b5a69f7d0941de09b50fa28c.zip |
Merge pull request #238 from pfalcon/bool_len
Implement __bool__ and __len__ via unary_op virtual method for all types.
Diffstat (limited to 'py/runtime0.h')
-rw-r--r-- | py/runtime0.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/py/runtime0.h b/py/runtime0.h index cd82b1412b..a0f553a896 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -1,8 +1,11 @@ typedef enum { - RT_UNARY_OP_NOT, // TODO remove this op since it's no longer needed + RT_UNARY_OP_BOOL, // __bool__ + RT_UNARY_OP_LEN, // __len__ RT_UNARY_OP_POSITIVE, RT_UNARY_OP_NEGATIVE, RT_UNARY_OP_INVERT, + // Used only for CPython-compatible codegeneration + RT_UNARY_OP_NOT, } rt_unary_op_t; typedef enum { |