1. 12 May, 2015 2 commits
    • Damien George's avatar
      py: Add mp_obj_get_int_truncated and use it where appropriate. · c50772d1
      Damien George authored
      mp_obj_get_int_truncated will raise a TypeError if the argument is not
      an integral type.  Use mp_obj_int_get_truncated only when you know the
      argument is a small or big int.
      c50772d1
    • 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
  2. 11 May, 2015 4 commits
  3. 10 May, 2015 2 commits
  4. 09 May, 2015 4 commits
  5. 08 May, 2015 3 commits
  6. 07 May, 2015 5 commits
  7. 06 May, 2015 9 commits
  8. 05 May, 2015 8 commits
  9. 04 May, 2015 3 commits