summaryrefslogtreecommitdiffstatshomepage
path: root/py/objslice.c
Commit message (Collapse)AuthorAge
* objsingleton: New home for Ellipsis and NotImplemented.Paul Sokolovsky2015-05-05
| | | | | | | Having NotImplemented as MP_OBJ_SENTINEL turned out to be problematic (it needs to be checked for in a lot of places, otherwise it'll crash as would pass MP_OBJ_IS_OBJ()), so made a proper singleton value like Ellipsis, both of them sharing the same type.
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
* py, unix: Allow to compile with -Wunused-parameter.Damien George2015-01-20
| | | | See issue #699.
* py: Move to guarded includes, everywhere in py/ core.Damien George2015-01-01
| | | | Addresses issue #1022.
* py: Make functions static where appropriate.Damien George2014-12-10
|
* Rename bultins config variables to MICROPY_PY_BUILTINS_*.Damien George2014-06-01
| | | | | | | | | | This renames: MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT See issue #35 for discussion.
* objslice: Support arbitrary objects start, stop, and step.Paul Sokolovsky2014-05-25
| | | | | Older int-only encoding is not expressive enough to support arbitrary slice assignment operations.
* Rename configuration variables controling Python features.Damien George2014-05-24
| | | | Now of the form MICROPY_PY_*. See issue #35.
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky2014-05-02
| | | | Specifically, nlr.h does.
* py: Rename old const type objects to mp_type_* for consistency.Damien George2014-03-29
|
* py: Change mp_const_* objects to macros.Damien George2014-03-29
| | | | Addresses issue #388.
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* 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.
* 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().
* 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
* type->print(): Distinguish str() and repr() variety by passing extra param.Paul Sokolovsky2014-01-15
|
* Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ↵Damien George2014-01-07
|\ | | | | | | | | | | | | ian-v-cplusplus Conflicts: py/objcomplex.c
| * Co-exist with C++ (issue #85)ian-v2014-01-06
|/
* Convert many object types structs to use C99 tagged initializer syntax.Paul Sokolovsky2014-01-05
|
* Convert Python types to proper Python type hierarchy.Damien George2014-01-04
| | | | Now much more inline with how CPython does types.
* Add ellipsis object.Damien George2014-01-04
|
* slice: Implement special handling of omitted start/stop indexes.Paul Sokolovsky2014-01-04
|
* Add basic implementation of slice object.Paul Sokolovsky2014-01-04
So far, only start and stop integer indexes are supported. Step is not supported, as well as objects of arbitrary types.