I know that it is not an incompatability as such, I just don't like it -- especially as, from the perspective of Python, it is called inverse, and it is used for that purpose in Sage.
What does NumPy use ~ for? If it is conjugate I could be swayed, but I highly doubt it (I think it is used bitwise but can't check now). Also I don't see the need for a seperate operator for conjugate. I could learn to like x.conj or x.C as a shorter form which doesn't clash with the operator name (although likely not use it myself as I normally do incremental optimization). I'll be back in a few hours. Feel free to vote me out, but I'd think new syntax candy like this can safely wait for 0.13? Dag Sverre Seljebotn -----Original Message----- From: Robert Bradshaw <rober...@math.washington.edu> Date: Thursday, Oct 8, 2009 6:14 am Subject: Re: [Cython] C++ complex support To: cython-...@codespeak.netreply-to: cython-dev@codespeak.net On Oct 7, 2009, at 9:05 PM, Dag Sverre Seljebotn wrote: > >> It's was the middle of the night in Norway when you posted that :-) >> >> Anyway, I'm 1 > >Did you forget a sign there? > >> on ~x meaning x.conjugate(), because I always vote for making >> Cython more like Python and less like C. > >It's currently an error for complex values in Python. > >> I can do the stuff necessarry for conjugate(), or give you hints, >> which do you want? I won't be able to do it for another day. >> >> Dag Sverre Seljebotn >> -----Original Message----- >> From: Lisandro Dalcin <dalc...@gmail.com> >> Date: Thursday, Oct 8, 2009 1:53 am >> Subject: Re: [Cython] C++ complex support >> To: cython-...@codespeak.netreply-to: cython-dev@codespeak.net >> >> On Wed, Oct 7, 2009 at 6:59 PM, Robert Bradshaw >>> <rober...@math.washington.edu> wrote: >>>> >>>> Don't reopen the ticket, make a new one for C++ complex support. >>>> >>> >>> Done: http://trac.cython.org/cython_trac/ticket/398 >>> >>>>> For the case of C, C99 complexes will be automatically used >>>>> ONLY if >>>>> _Complex_I is defined... of if the user explicitly pass >>>>> "-DPYX_CCOMPLEX=1" at C-compile time (or a Cython-included C header >>>>> #define PYX_CCOMPLEX=1), or if the directive "ccomplex=True". >>>>> >>>>> I'm still in doubt about how to handle 'ccomplex=True'... Should it >>>>> just enable by default using "#define PYX_CCOMPLEX=1", or actually >>>>> impact in code generation (as currently does)... >>>> >>>> I would be OK with it just changing the flag, with the code >>>> generation remaining unchanged. >>>> >>> >>> OK, this is work TBD in my patch... >>> >>>>> Ah! I forgot... I do not know how to implement z.conjugate(); the >>>>> C/C99/C++ support is there though... BTW, GCC seems to accept >>>>> "~z" for >>>>> complex conjugation (no idea if it is C99-standard or a >>>>> GCC-extension)... Perhaps Cython should accept this (non-Python) >>>>> syntax? I think it is nice. >>>> >>>> I know is sage we map ~z to 1/z (it is the __invert__ operator after >>>> all). Python doesn't define an __invert__ for their native complex >>>> type. I could go either way. >>>> >>> >>> IMHO, my brain can parse "~z" as z.conjugate(), but would have a hard >>> time realizing ~z is "1/z"... Anyway, you are the BDLF, it's up to >>> you... Or the champion who actually implement support for >>> z.conjugate()... Hey, Dag. Are you there? ;-) >>> >>> >>> >>> -- >>> Lisandro Dalcín >>> --------------- >>> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) >>> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) >>> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) >>> PTLC - Güemes 3450, (3000) Santa Fe, Argentina >>> Tel/Fax: +54-(0)342-451.1594 >>> _______________________________________________ >>> Cython-dev mailing list >>> Cython-dev@codespeak.net >>> http://codespeak.net/mailman/listinfo/cython-dev >>> >> >> _______________________________________________ >> Cython-dev mailing list >> Cython-dev@codespeak.net >> http://codespeak.net/mailman/listinfo/cython-dev > >_______________________________________________ >Cython-dev mailing list >Cython-dev@codespeak.net >http://codespeak.net/mailman/listinfo/cython-dev >
_______________________________________________ Cython-dev mailing list Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev