[issue25839] negative zero components are ignored in complex number literals

Mark Lundeberg report at bugs.python.org
Fri Dec 11 04:01:36 EST 2015


Mark Lundeberg added the comment:

Good point, it is doing (int-complex), observe also the following pecularities:

>>> -0 - 0j
0j
>>> -0. - 0j
(-0+0j)
>>> -0j
-0j
>>> 0-0j
0j
>>> -(0j)
(-0-0j)
>>> 0.+(-0j)
0j

Does this mean the bug is in repr() ? As I understand the output of repr() is supposed to be something that can evaluated to recreate the same object. However I am unsure whether it would be nicer if repr() were to yield 'complex(-0.,-0.)' or '-(-0.+0j)'.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25839>
_______________________________________


More information about the Python-bugs-list mailing list