This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mjacob
Recipients mjacob
Date 2013-03-02.11:28:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za>
In-reply-to
Content
When evaluating, signed zero complex numbers aren't recovered correctly.
>>> -0j
(-0-0j)
>>> (-0-0j)
0j
>>> 0j
0j

According to http://docs.python.org/dev/reference/datamodel.html#object.__repr__ the representation can be used to recreate an object with the same value. Shouldn't this also be possible with complex numbers?

When using complex('...'), round-trip works correctly. While this can be used to recover the exact number, i find it confusing that complex('...') isn't the same as eval('...').
>>> complex('-0j')
-0j
>>> complex('(-0-0j)')
(-0-0j)
>>> complex('0j')
0j
History
Date User Action Args
2013-03-02 11:28:04mjacobsetrecipients: + mjacob
2013-03-02 11:28:04mjacobsetmessageid: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za>
2013-03-02 11:28:04mjacoblinkissue17336 messages
2013-03-02 11:28:03mjacobcreate