objtype: Separate __new__ and __init__ methods.

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.
This commit is contained in:
Paul Sokolovsky
2014-05-18 20:37:18 +03:00
parent eee31288dd
commit 13684fd60b
2 changed files with 50 additions and 62 deletions

View File

@@ -34,6 +34,7 @@ Q(__class__)
Q(__doc__)
Q(__import__)
Q(__init__)
Q(__new__)
Q(__locals__)
Q(__main__)
Q(__module__)