[issue27363] Complex with negative zero imaginary part

R. David Murray report at bugs.python.org
Wed Jun 29 10:09:01 EDT 2016


R. David Murray added the comment:

Right, that isn't the invariant.  Eval is the normal invariant, but not all classes *can* meet it, in which case if they can provide a repr that *can* be turned back into the value losslessly somehow, that's better than not doing so at all.

Still, changing the repr would be the best way to meet the desired invariant, if we're willing to do that.  This could be the first stdlib case of a non-string having a useful __str__ if we make the __str__ still return what the current __repr__ does.

----------

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


More information about the Python-bugs-list mailing list