1. 05 Jun, 2015 1 commit
  2. 12 May, 2015 1 commit
    • Damien George's avatar
      py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function. · c2a4e4ef
      Damien George authored
      Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as
      the operator argument.  Hashing for int, str and bytes still go via
      fast-path in mp_unary_op since they are the most common objects which
      need to be hashed.
      
      This lead to quite a bit of code cleanup, and should be more efficient
      if anything.  It saves 176 bytes code space on Thumb2, and 360 bytes on
      x86.
      
      The only loss is that the error message "unhashable type" is now the
      more generic "unsupported type for __hash__".
      c2a4e4ef
  3. 05 May, 2015 1 commit
    • Paul Sokolovsky's avatar
      objsingleton: New home for Ellipsis and NotImplemented. · 76677270
      Paul Sokolovsky authored
      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.
      76677270
  4. 04 May, 2015 1 commit
  5. 20 Apr, 2015 1 commit
  6. 19 Apr, 2015 1 commit
  7. 16 Apr, 2015 3 commits
    • Damien George's avatar
    • Damien George's avatar
      py: Make mp_sys_stdout_print object, wrapping sys.stdout for mp_print*. · 5ae5ec98
      Damien George authored
      So now all printing should go via either mp_plat_print or
      mp_sys_stdout_print.
      5ae5ec98
    • 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
  8. 09 Apr, 2015 1 commit
  9. 06 Apr, 2015 2 commits
  10. 30 Mar, 2015 1 commit
  11. 19 Mar, 2015 1 commit
  12. 14 Mar, 2015 1 commit
  13. 02 Mar, 2015 1 commit
  14. 23 Feb, 2015 1 commit
  15. 14 Feb, 2015 1 commit
  16. 28 Jan, 2015 2 commits
  17. 21 Jan, 2015 1 commit
  18. 12 Jan, 2015 1 commit
  19. 04 Jan, 2015 1 commit
  20. 03 Jan, 2015 1 commit
  21. 01 Jan, 2015 1 commit
  22. 27 Dec, 2014 1 commit
    • Damien George's avatar
      py: Allow to properly disable builtin "set" object. · e37dcaaf
      Damien George authored
      This patch makes MICROPY_PY_BUILTINS_SET compile-time option fully
      disable the builtin set object (when set to 0).  This includes removing
      set constructor/comprehension from the grammar, the compiler and the
      emitters.  Now, enabling set costs 8168 bytes on unix x64, and 3576
      bytes on stmhal.
      e37dcaaf
  23. 19 Dec, 2014 1 commit
  24. 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
  25. 27 Nov, 2014 1 commit
  26. 06 Nov, 2014 1 commit
  27. 31 Oct, 2014 1 commit
  28. 22 Oct, 2014 1 commit
  29. 03 Oct, 2014 1 commit
  30. 13 Sep, 2014 2 commits
  31. 07 Sep, 2014 1 commit
  32. 30 Aug, 2014 2 commits
  33. 24 Aug, 2014 1 commit
  34. 12 Aug, 2014 1 commit
    • Damien George's avatar
      py: Implement builtin reversed() function. · 4c03b3a8
      Damien George authored
      reversed function now implemented, and works for tuple, list, str, bytes
      and user objects with __len__ and __getitem__.
      
      Renamed mp_builtin_len to mp_obj_len to make it publically available (eg
      for reversed).
      4c03b3a8