New submission from Manuel Jacob:

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

----------
messages: 183313
nosy: mjacob
priority: normal
severity: normal
status: open
title: Complex number representation round-trip doesn't work with signed zero 
values
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17336>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to