summaryrefslogtreecommitdiffstatshomepage
path: root/py/objarray.c
Commit message (Collapse)AuthorAge
* Implement proper exception type hierarchy.Damien George2014-02-15
| | | | | | | | | | | | | | Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
* Change mp_obj_type_t.name from const char * to qstr.Damien George2014-02-15
| | | | | | Ultimately all static strings should be qstr. This entry in the type structure is only used for printing error messages (to tell the type of the bad argument), and printing objects that don't supply a .print method.
* objarray: Refactor to use array accessors from binary.c .Paul Sokolovsky2014-02-14
|
* Replace global "static" -> "STATIC", to allow "analysis builds". Part 1.Paul Sokolovsky2014-02-12
| | | | | | | | Some tools do not support local/static symbols (one example is GNU ld map file). Exposing all functions will allow to do detailed size comparisons, etc. Also, added bunch of statics where they were missing, and replaced few identity functions with global mp_identity().
* Make mp_obj_str_get_data return char* instead of byte*.Damien George2014-02-08
| | | | | Can't decide which is better for string type, char or byte pointer. Changing to char removes a few casts. Really need to do proper unicode.
* Implement __bool__ and __len__ via unary_op virtual method for all types.Paul Sokolovsky2014-01-30
| | | | | | | __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.
* mp_obj_new_bytearray_by_ref(): Allow to create array by reference.Paul Sokolovsky2014-01-29
| | | | This is special feature for FFI.
* bytearray: Print objects properly.Paul Sokolovsky2014-01-28
|
* array: CPython prints empty arrays inconsistently (only typecode, no []).Paul Sokolovsky2014-01-28
|
* array.array: Allow to create empty arrays.Paul Sokolovsky2014-01-28
|
* Second stage of qstr revamp: uPy str object can be qstr or not.Damien George2014-01-22
|
* array: Implement iterator.Paul Sokolovsky2014-01-21
|
* Add len() support for arrays.Paul Sokolovsky2014-01-21
|
* Revamp qstrs: they now include length and hash.Damien George2014-01-21
| | | | | Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
* Add skeleton implementation of array.array and bytearray.Paul Sokolovsky2014-01-18
So far, only storage, initialization, repr() and buffer protocol is implemented - alredy suitable for passing binary data around.