Paul Sokolovsky
c1d9bbc345
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.
11 years ago
Paul Sokolovsky
7f11c794a5
mp_obj_new_bytearray_by_ref(): Allow to create array by reference.
This is special feature for FFI.
11 years ago
Paul Sokolovsky
1801421f6d
bytearray: Print objects properly.
11 years ago
Paul Sokolovsky
7e652af242
array: CPython prints empty arrays inconsistently (only typecode, no []).
11 years ago
Paul Sokolovsky
11973b48b5
array.array: Allow to create empty arrays.
11 years ago
Damien George
5fa93b6755
Second stage of qstr revamp: uPy str object can be qstr or not.
11 years ago
Paul Sokolovsky
09ce05996a
array: Implement iterator.
11 years ago
Paul Sokolovsky
33996685df
Add len() support for arrays.
11 years ago
Damien George
55baff4c9b
Revamp qstrs: they now include length and hash.
Can now have null bytes in strings. Can define ROM qstrs per port using
qstrdefsport.h
11 years ago
Paul Sokolovsky
427905cedd
Add skeleton implementation of array.array and bytearray.
So far, only storage, initialization, repr() and buffer protocol is
implemented - alredy suitable for passing binary data around.
11 years ago