These are chat archives for dropbox/pyston
Hi, I know it is weekend now. But could I ask one more question please?
How to let the subclass of
`complex has correct
tp_name. Now the subclass of
complex always is
complex. I cross-compared
complex code, but still don't know where cause the error.
class complex0(complex): """Test usage of __complex__() when inheriting from 'complex'""" def __complex__(self): return 42j c0 = complex0(1j) print(type(c0))
Either my new implementation of
complexNew, or the master branch
complexNew with commented
RELEASE_ASSERT(_cls == complex_cls, ""); will output same result.
_cls check should use
print type(c0) is complex0, type(c0) is complex
print(type(c0) is complex0, type(c0) is complex) # CPython (True, False) # Pyston (False, True)
The output of Pyston was same as CPython
class Foo(float): pass bar = Foo() print(type(bar) is float, type(bar) is Foo)
complexwhich is a complex subclass that have custom
new (cls) BoxedComplex()?
new (cls) BoxedComplex()mean?
(cls)part it default to setting the class
operator new()what the class of the object is
(cls)is actually allocation-arguments rather than constructor-arguments
DEFAULT_CLASS(int_cls)annotations in the C++ class definitions are for
complexNew. Thanks for your time!