Message183313
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 |
|
Date |
User |
Action |
Args |
2013-03-02 11:28:04 | mjacob | set | recipients:
+ mjacob |
2013-03-02 11:28:04 | mjacob | set | messageid: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> |
2013-03-02 11:28:04 | mjacob | link | issue17336 messages |
2013-03-02 11:28:03 | mjacob | create | |
|