Add some function to old style class #787
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note:
__complex__
could callcomplexNew
incomplex.cpp
correctly. ButcomplexNew
need some improvements to supportstr
and custom type.__unicode__
,__get__
,__set__
,__delete__
are exact same as in CPython. IMHO, there is no need to write additional code inclassobj.cpp
.__missing__
only work in subclass of dict. So no need to write it inclassobj.cpp
.__coerce__
in old style class could call the new addedcoerce
builtin function correctly. But thecoerce
need further improvements.Update
import types; print sorted(types.InstanceType.__dict__.keys())
in CPython. Pyston has extra__base__
.__doc__
,__new__
seems as instance's class attributes in Pyston. If these three attribute were fine, then the old style class support was completed.__getslice__
and some other functions didn't change. Because if we copyinstance_slice
from CPython, then apply some change, it will very similar as the current one. But I will try to copy CPython code in next PR as much as possible.