1. 21 May, 2014 4 commits
  2. 19 May, 2014 1 commit
    • Paul Sokolovsky's avatar
      objtype: Separate __new__ and __init__ methods. · 13684fd6
      Paul Sokolovsky authored
      Now schedule is: for native types, we call ->make_new() C-level method, which
      should perform actions of __new__ and __init__ (note that this is not
      compliant, but is efficient), but for user types, __new__ and __init__ are
      called as expected.
      
      Also, make sure we convert scalar attribute value to a bound-pair tight in
      mp_obj_class_lookup() method, which avoids converting it again and again in
      its callers.
      13684fd6
  3. 13 May, 2014 1 commit
  4. 11 May, 2014 3 commits
    • Damien George's avatar
      py: Use mp_arg_check_num in more places. · ee7a880d
      Damien George authored
      Updated functions now do proper checking that n_kw==0, and are simpler
      because they don't have to explicitly raise an exception.  Down side is
      that the error messages no longer include the function name, but that's
      acceptable.
      
      Saves order 300 text bytes on x64 and ARM.
      ee7a880d
    • Paul Sokolovsky's avatar
      objtuple: Go out of the way to support comparison of subclasses. · ea970809
      Paul Sokolovsky authored
      Two things are handled here: allow to compare native subtypes of tuple,
      e.g. namedtuple (TODO: should compare type too, currently compared
      duck-typedly by content). Secondly, allow user sunclasses of tuples
      (and its subtypes) be compared either. "Magic" I did previously in
      objtype.c covers only one argument (lhs is many), so we're in trouble
      when lhs is native type - there's no other option besides handling
      rhs in special manner. Fortunately, this patch outlines approach with
      fast path for native types.
      ea970809
    • Paul Sokolovsky's avatar
      py: Don't try to "bind" types store as attributes of objects. · 9511f60f
      Paul Sokolovsky authored
      This was hit when trying to make urlparse.py from stdlib run. Took
      quite some time to debug.
      
      TODO: Reconsile bound method creation process better, maybe callable is
      to generic type to bind at all?
      9511f60f
  5. 10 May, 2014 4 commits
  6. 03 May, 2014 2 commits
  7. 02 May, 2014 2 commits
  8. 01 May, 2014 2 commits
  9. 29 Apr, 2014 3 commits
  10. 25 Apr, 2014 1 commit
  11. 21 Apr, 2014 1 commit
  12. 17 Apr, 2014 2 commits
  13. 14 Apr, 2014 1 commit
  14. 13 Apr, 2014 1 commit
  15. 08 Apr, 2014 2 commits
  16. 05 Apr, 2014 3 commits
  17. 02 Apr, 2014 1 commit
  18. 31 Mar, 2014 3 commits
    • Damien George's avatar
      py: Implement __getattr__. · e44d26ae
      Damien George authored
      It's not completely satisfactory, because a failed call to __getattr__
      should not raise an exception.
      
      __setattr__ could be implemented, but it would slow down all stores to a
      user created object.  Need to implement some caching system.
      e44d26ae
    • Paul Sokolovsky's avatar
      objtype: Wrap .__name__ handling in MICROPY_CPYTHON_COMPAT. · b509f739
      Paul Sokolovsky authored
      Because it's runtime reflection feature, not required for many apps.
      Rant time:
      Python could really use better str() vs repr() distinction, for example,
      repr(type) could be "<class 'foo'>" (as it is now), and str(type) just
      "foo". But alas, getting straight name requires adhoc attribute.
      b509f739
    • Paul Sokolovsky's avatar
      objtype: Add virtual __name__ attribute. · e5666701
      Paul Sokolovsky authored
      It's virtual because it's not shown in dir(...). (That's also how CPython
      has it).
      e5666701
  19. 30 Mar, 2014 2 commits
    • Damien George's avatar
      Merge map.h into obj.h. · df6567e6
      Damien George authored
      Pretty much everyone needs to include map.h, since it's such an integral
      part of the Micro Python object implementation.  Thus, the definitions
      are now in obj.h instead.  map.h is removed.
      df6567e6
    • Damien George's avatar
      Rename rt_* to mp_*. · d17926db
      Damien George authored
      Mostly just a global search and replace.  Except rt_is_true which
      becomes mp_obj_is_true.
      
      Still would like to tidy up some of the names, but this will do for now.
      d17926db
  20. 29 Mar, 2014 1 commit