1. 14 Mar, 2015 1 commit
  2. 13 Mar, 2015 1 commit
  3. 03 Mar, 2015 1 commit
  4. 27 Feb, 2015 1 commit
    • Paul Sokolovsky's avatar
      objarray: Implement array slice assignment. · cefcbb22
      Paul Sokolovsky authored
      This is rarely used feature which takes enough code to implement, so is
      controlled by MICROPY_PY_ARRAY_SLICE_ASSIGN config setting, default off.
      But otherwise it may be useful, as allows to update arbitrary-sized data
      buffers in-place.
      
      Slice is yet to implement, and actually, slice assignment implemented in
      such a way that RHS of assignment should be array of the exact same item
      typecode as LHS. CPython has it more relaxed, where RHS can be any sequence
      of compatible types (e.g. it's possible to assign list of int's to a
      bytearray slice).
      
      Overall, when all "slice write" features are implemented, it may cost ~1KB
      of code.
      cefcbb22
  5. 22 Feb, 2015 1 commit
  6. 30 Jan, 2015 1 commit
  7. 16 Jan, 2015 1 commit
  8. 14 Jan, 2015 1 commit
  9. 10 Jan, 2015 1 commit
  10. 09 Jan, 2015 2 commits
  11. 07 Jan, 2015 2 commits
    • Damien George's avatar
      py: Add option to cache map lookup results in bytecode. · 7ee91cf8
      Damien George authored
      This is a simple optimisation inspired by JITing technology: we cache in
      the bytecode (using 1 byte) the offset of the last successful lookup in
      a map. This allows us next time round to check in that location in the
      hash table (mp_map_t) for the desired entry, and if it's there use that
      entry straight away.  Otherwise fallback to a normal map lookup.
      
      Works for LOAD_NAME, LOAD_GLOBAL, LOAD_ATTR and STORE_ATTR opcodes.
      
      On a few tests it gives >90% cache hit and greatly improves speed of
      code.
      
      Disabled by default.  Enabled for unix and stmhal ports.
      7ee91cf8
    • Damien George's avatar
      py: Put all global state together in state structures. · b4b10fd3
      Damien George authored
      This patch consolidates all global variables in py/ core into one place,
      in a global structure.  Root pointers are all located together to make
      GC tracing easier and more efficient.
      b4b10fd3
  12. 01 Jan, 2015 1 commit
  13. 16 Dec, 2014 1 commit
  14. 14 Dec, 2014 1 commit
  15. 09 Dec, 2014 1 commit
    • 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
  16. 29 Nov, 2014 1 commit
  17. 22 Nov, 2014 1 commit
  18. 16 Nov, 2014 1 commit
  19. 25 Oct, 2014 1 commit
  20. 23 Oct, 2014 1 commit
  21. 22 Oct, 2014 1 commit
  22. 12 Oct, 2014 1 commit
  23. 11 Oct, 2014 2 commits
  24. 09 Oct, 2014 1 commit
  25. 07 Oct, 2014 1 commit
  26. 29 Sep, 2014 1 commit
  27. 17 Sep, 2014 1 commit
  28. 06 Sep, 2014 1 commit
  29. 03 Sep, 2014 2 commits
  30. 24 Aug, 2014 2 commits
  31. 23 Aug, 2014 1 commit
    • Paul Sokolovsky's avatar
      modtermios: Add "termios" unix module, subset of CPython's. · 4f9ebade
      Paul Sokolovsky authored
      Also provides setraw() function from "tty" module (which in CPython is
      implemented in Python). The idea here is that 95% of "termios" module usage
      is to set raw mode to allow access to normal serial devices. Then, instead
      of exporting gazillion termios symbols, it's better to implement it in C,
      and export minimal number of symbols (mostly baud rates and drain values).
      4f9ebade
  32. 12 Aug, 2014 1 commit
  33. 25 Jul, 2014 1 commit
    • Dave Hylands's avatar
      Add support for storing args during an exception raised by an irq. · 5b7fd20f
      Dave Hylands authored
      The user code should call micropython.alloc_emergency_exception_buf(size)
      where size is the size of the buffer used to print the argument
      passed to the exception.
      
      With the test code from #732, and a call to
      micropython.alloc_emergenncy_exception_buf(100) the following error is
      now printed:
      ```python
      >>> import heartbeat_irq
      Uncaught exception in Timer(4) interrupt handler
      Traceback (most recent call last):
        File "0://heartbeat_irq.py", line 14, in heartbeat_cb
      NameError: name 'led' is not defined
      ```
      5b7fd20f
  34. 19 Jul, 2014 1 commit
    • Damien George's avatar
      py: Add stream reading of n unicode chars; unicode support by default. · 1694bc73
      Damien George authored
      With unicode enabled, this patch allows reading a fixed number of
      characters from text-mode streams; eg file.read(5) will read 5 unicode
      chars, which can made of more than 5 bytes.
      
      For an ASCII stream (ie no chars > 127) it only needs to do 1 read.  If
      there are lots of non-ASCII chars in a stream, then it needs multiple
      reads of the underlying object.
      
      Adds a new test for this case.  Enables unicode support by default on
      unix and stmhal ports.
      1694bc73
  35. 13 Jul, 2014 1 commit