Skip to content
Snippets Groups Projects
  1. Oct 04, 2017
    • Damien George's avatar
      all: Remove inclusion of internal py header files. · a3dc1b19
      Damien George authored
      Header files that are considered internal to the py core and should not
      normally be included directly are:
          py/nlr.h - internal nlr configuration and declarations
          py/bc0.h - contains bytecode macro definitions
          py/runtime0.h - contains basic runtime enums
      
      Instead, the top-level header files to include are one of:
          py/obj.h - includes runtime0.h and defines everything to use the
              mp_obj_t type
          py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
              and defines everything to use the general runtime support functions
      
      Additional, specific headers (eg py/objlist.h) can be included if needed.
      a3dc1b19
  2. Sep 19, 2017
  3. Sep 06, 2017
    • tll's avatar
      py/objstr: Add check for valid UTF-8 when making a str from bytes. · 68c28174
      tll authored
      This patch adds a function utf8_check() to check for a valid UTF-8 encoded
      string, and calls it when constructing a str from raw bytes.  The feature
      is selectable at compile time via MICROPY_PY_BUILTINS_STR_UNICODE_CHECK and
      is enabled if unicode is enabled.  It costs about 110 bytes on Thumb-2, 150
      bytes on Xtensa and 170 bytes on x86-64.
      68c28174
  4. Aug 29, 2017
  5. Aug 28, 2017
  6. Aug 13, 2017
    • Javier Candeira's avatar
      all: Raise exceptions via mp_raise_XXX · 35a1fea9
      Javier Candeira authored
        - Changed: ValueError, TypeError, NotImplementedError
        - OSError invocations unchanged, because the corresponding utility
          function takes ints, not strings like the long form invocation.
        - OverflowError, IndexError and RuntimeError etc. not changed for now
          until we decide whether to add new utility functions.
      35a1fea9
  7. Aug 09, 2017
  8. Jul 31, 2017
  9. Jul 03, 2017
  10. Jul 02, 2017
  11. Jun 07, 2017
  12. Jun 02, 2017
  13. May 29, 2017
  14. Apr 02, 2017
  15. Mar 29, 2017
    • Damien George's avatar
    • Damien George's avatar
      py: Convert mp_uint_t to size_t for tuple/list accessors. · 6213ad7f
      Damien George authored
      This patch changes mp_uint_t to size_t for the len argument of the
      following public facing C functions:
      
      mp_obj_tuple_get
      mp_obj_list_get
      mp_obj_get_array
      
      These functions take a pointer to the len argument (to be filled in by the
      function) and callers of these functions should update their code so the
      type of len is changed to size_t.  For ports that don't use nan-boxing
      there should be no change in generate code because the size of the type
      remains the same (word sized), and in a lot of cases there won't even be a
      compiler warning if the type remains as mp_uint_t.
      
      The reason for this change is to standardise on the use of size_t for
      variables that count memory (or memory related) sizes/lengths.  It helps
      builds that use nan-boxing.
      6213ad7f
  16. Mar 23, 2017
  17. Mar 20, 2017
    • stijn's avatar
      py/objstr: Use better msg in bad implicit str/bytes conversion exception · bf29fe2e
      stijn authored
      Instead of always reporting some object cannot be implicitly be converted
      to a 'str', even when it is a 'bytes' object, adjust the logic so that
      when trying to convert str to bytes it is shown like that.
      This will still report bad implicit conversion from e.g. 'int to bytes'
      as 'int to str' but it will not result in the confusing
      'can't convert 'str' object to str implicitly' anymore for calls like
      b'somestring'.count('a').
      bf29fe2e
  18. Mar 16, 2017
  19. Mar 07, 2017
  20. Feb 16, 2017
  21. Feb 03, 2017
  22. Jan 26, 2017
    • Paul Sokolovsky's avatar
      py/objstr: Optimize string concatenation with empty string. · e2e66329
      Paul Sokolovsky authored
      In this, don't allocate copy, just return non-empty string. This helps
      with a standard pattern of buffering data in case of short reads:
      
          buf = b""
          while ...:
              s = f.read(...)
              buf += s
              ...
      
      For a typical case when single read returns all data needed, there won't
      be extra allocation. This optimization helps uasyncio.
      e2e66329
  23. Sep 27, 2016
  24. Sep 02, 2016
  25. Aug 14, 2016
  26. Aug 12, 2016
  27. Aug 07, 2016
  28. May 21, 2016
  29. May 13, 2016
  30. May 09, 2016
  31. May 07, 2016
  32. Apr 14, 2016
Loading