summaryrefslogtreecommitdiffstatshomepage
path: root/tests/bytecode/pylib-tests/struct.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-30 04:37:19 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-30 04:37:19 +0200
commitc1d9bbc3453454aceb28f51e72e4aeb8ef1c12eb (patch)
treedb7cd93c99583a858ef94b3dab95b882832da251 /tests/bytecode/pylib-tests/struct.py
parentcdd2c62e07549e36dba00bc37d7ba7a4cd41ad50 (diff)
downloadmicropython-c1d9bbc3453454aceb28f51e72e4aeb8ef1c12eb.tar.gz
micropython-c1d9bbc3453454aceb28f51e72e4aeb8ef1c12eb.zip
Implement __bool__ and __len__ via unary_op virtual method for all types.
__bool__() and __len__() are just the same as __neg__() or __invert__(), and require efficient dispatching implementation (not requiring search/lookup). type->unary_op() is just the right choice for this short of adding standalone virtual method(s) to already big mp_obj_type_t structure.
Diffstat (limited to 'tests/bytecode/pylib-tests/struct.py')
0 files changed, 0 insertions, 0 deletions