[pypy-issue] [issue1544] numpypy: complex(complex128)

mattip tracker at bugs.pypy.org
Wed Jul 31 00:09:06 CEST 2013


mattip <matti.picus at gmail.com> added the comment:

this fails in stdobjspace w_complextype
here is the relevant traceback, how should this work properly?

<132-codegen /home/matti/pypy_stuff/pypy/rpython/tool/sourcetools.py:175>:3: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
space = StdObjSpace, w_complextype = <W_TypeObject(complex)>, w_real = 
<pypy.module.micronumpy.interp_boxes.W_Complex128Box object at 0x54ff750>, 
w_imag = None

    @unwrap_spec(w_real = WrappedDefault(0.0))
    def descr__new__(space, w_complextype, w_real, w_imag=None):
        from pypy.objspace.std.complexobject import W_ComplexObject
    
        # if w_real is already a complex number and there is no second
        # argument, return it.  Note that we cannot return w_real if
        # it is an instance of a *subclass* of complex, or if w_complextype
        # is itself a subclass of complex.
        noarg2 = w_imag is None
        if (noarg2 and space.is_w(w_complextype, space.w_complex)
                   and space.is_w(space.type(w_real), space.w_complex)):
            return w_real

----------
nosy: +mattip
status: unread -> chatting

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1544>
________________________________________


More information about the pypy-issue mailing list