Skip to content
Snippets Groups Projects
Commit c1d9bbc3 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

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.
parent cdd2c62e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment