1. 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
  2. 08 Dec, 2014 1 commit
    • Paul Sokolovsky's avatar
      modsys: Add sys.print_exception(exc, file=sys.stdout) function. · 46c3ab20
      Paul Sokolovsky authored
      The function is modeled after traceback.print_exception(), but unbloated,
      and put into existing module to save overhead on adding another module.
      Compliant traceback.print_exception() is intended to be implemented in
      micropython-lib in terms of sys.print_exception().
      
      This change required refactoring mp_obj_print_exception() to take pfenv_t
      interface arguments.
      
      Addresses #751.
      46c3ab20
  3. 05 Dec, 2014 3 commits
  4. 04 Dec, 2014 1 commit
  5. 02 Dec, 2014 1 commit
  6. 01 Dec, 2014 1 commit
  7. 30 Nov, 2014 2 commits
  8. 29 Nov, 2014 2 commits
  9. 27 Nov, 2014 5 commits
  10. 22 Nov, 2014 1 commit
  11. 21 Nov, 2014 1 commit
  12. 16 Nov, 2014 3 commits
  13. 15 Nov, 2014 1 commit
  14. 06 Nov, 2014 3 commits
  15. 05 Nov, 2014 5 commits
  16. 04 Nov, 2014 1 commit
  17. 03 Nov, 2014 2 commits
  18. 02 Nov, 2014 1 commit
  19. 31 Oct, 2014 2 commits
  20. 30 Oct, 2014 3 commits
    • stijn's avatar
      mpz: Fix 64bit msvc build · 0e557fac
      stijn authored
      msvc does not treat 1L a 64bit integer hence all occurences of shifting it left or right
      result in undefined behaviour since the maximum allowed shift count for 32bit ints is 31.
      Forcing the correct type explicitely, stored in MPZ_LONG_1, solves this.
      0e557fac
    • Paul Sokolovsky's avatar
      objstr: Allow to convert any buffer proto object to str. · e62a0fe3
      Paul Sokolovsky authored
      Original motivation is to support converting bytearrays, but easier to just
      support buffer protocol at all.
      e62a0fe3
    • Paul Sokolovsky's avatar
      py: mp_obj_str_get_str(): Work with bytes too. · 31619cc5
      Paul Sokolovsky authored
      It should be fair to say that almost in all cases where some API call
      expects string, it should be also possible to pass byte string. For example,
      it should be open/delete/rename file with name as bytestring. Note that
      similar change was done quite a long ago to mp_obj_str_get_data().
      31619cc5