Skip to content
Snippets Groups Projects
  1. Oct 06, 2015
  2. May 04, 2015
  3. Apr 16, 2015
    • Damien George's avatar
    • Damien George's avatar
      py: Overhaul and simplify printf/pfenv mechanism. · 7f9d1d6a
      Damien George authored
      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.
      7f9d1d6a
  4. Apr 11, 2015
  5. Mar 20, 2015
    • Paul Sokolovsky's avatar
      py: Implement core of OrderedDict type. · 0ef01d0a
      Paul Sokolovsky authored
      Given that there's already support for "fixed table" maps, which are
      essentially ordered maps, the implementation of OrderedDict just extends
      "fixed table" maps by adding an "is ordered" flag and add/remove
      operations, and reuses 95% of objdict code, just making methods tolerant
      to both dict and OrderedDict.
      
      Some things are missing so far, like CPython-compatible repr and comparison.
      
      OrderedDict is Disabled by default; enabled on unix and stmhal ports.
      0ef01d0a
  6. Jan 20, 2015
  7. Jan 07, 2015
  8. Jan 01, 2015
  9. Dec 09, 2014
    • Damien George's avatar
      py: Allow builtins to be overridden. · 78d702c3
      Damien George authored
      This patch adds a configuration option (MICROPY_CAN_OVERRIDE_BUILTINS)
      which, when enabled, allows to override all names within the builtins
      module.  A builtins override dict is created the first time the user
      assigns to a name in the builtins model, and then that dict is searched
      first on subsequent lookups.  Note that this implementation doesn't
      allow deleting of names.
      
      This patch also does some refactoring of builtins code, creating the
      modbuiltins.c file.
      
      Addresses issue #959.
      78d702c3
  10. Nov 04, 2014
  11. Sep 08, 2014
  12. May 03, 2014
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      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/.
      04b9147e
  13. May 02, 2014
  14. Apr 08, 2014
  15. Apr 05, 2014
  16. Mar 30, 2014
    • Damien George's avatar
      Merge map.h into obj.h. · df6567e6
      Damien George authored
      Pretty much everyone needs to include map.h, since it's such an integral
      part of the Micro Python object implementation.  Thus, the definitions
      are now in obj.h instead.  map.h is removed.
      df6567e6
  17. Mar 25, 2014
  18. Mar 24, 2014
    • mux's avatar
      Add mp_obj_module_register · 89d45248
      mux authored
      * Add function to load static modules.
      * Use module_register to pyb module.
      89d45248
  19. Mar 17, 2014
    • xbe's avatar
      py: Clean up includes. · efe34223
      xbe authored
      Remove unnecessary includes. Add includes that improve portability.
      efe34223
  20. Mar 08, 2014
    • Damien George's avatar
      Implement ROMable modules. Add math module. · 0c36da0b
      Damien George authored
      mp_module_obj_t can now be put in ROM.
      
      Configuration of float type is now similar to longint: can now choose
      none, float or double as the implementation.
      
      math module has basic math functions.  For STM port, these are not yet
      implemented (they are just stub functions).
      0c36da0b
  21. Feb 15, 2014
    • Damien George's avatar
      Implement proper exception type hierarchy. · c5966128
      Damien George authored
      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.
      c5966128
    • Damien George's avatar
      Change mp_obj_type_t.name from const char * to qstr. · a71c83a1
      Damien George authored
      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.
      a71c83a1
  22. Feb 12, 2014
  23. Feb 05, 2014
  24. Jan 22, 2014
  25. Jan 21, 2014
  26. Jan 19, 2014
    • Paul Sokolovsky's avatar
      Implement modules as singletons Python semantics. · d720ab52
      Paul Sokolovsky authored
      In Python, importing module several times returns same underlying module
      object. This also fixes import statement handling for builtin modules.
      
      There're still issues:
      1. CPython exposes set of loaded modules as sys.modules, we may want to
      do that either.
      2. Builtin modules are implicitly imported, which is not really correct.
      We should separate registering a (builtin) module and importing a module.
      CPython keeps builtin module names in sys.builtin_module_names .
      d720ab52
  27. Jan 18, 2014
    • Damien George's avatar
      Make VM stack grow upwards, and so no reversed args arrays. · 20006dbb
      Damien George authored
      Change state layout in VM so the stack starts at state[0] and grows
      upwards.  Locals are at the top end of the state and number downwards.
      This cleans up a lot of the interface connecting the VM to C: now all
      functions that take an array of Micro Python objects are in order (ie no
      longer in reverse).
      
      Also clean up C API with keyword arguments (call_n and call_n_kw
      replaced with single call method that takes keyword arguments).  And now
      make_new takes keyword arguments.
      
      emitnative.c has not yet been changed to comply with the new order of
      stack layout.
      20006dbb
  28. Jan 15, 2014
  29. Jan 09, 2014
  30. Jan 08, 2014
  31. Jan 07, 2014
  32. Jan 06, 2014
Loading