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.

classification
Title: bug in doctest when comparing - 0.0 == 0.0
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Zé Vinícius, r.david.murray
Priority: normal Keywords:

Created on 2017-09-26 22:02 by Zé Vinícius, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg303081 - (view) Author: Zé Vinícius (Zé Vinícius) Date: 2017-09-26 22:02
See https://github.com/pytest-dev/pytest/issues/2796#event-1266625358
msg303083 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-09-27 00:34
Can you explain why you think that is a bug in doctest?  It looks like you are getting different output than you expect, but that by itself wouldn't be a bug in doctest.
msg303084 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-09-27 00:35
To be clear: doctest compares strings, so "-0.0" is not the same as "0.0" to doctest.
msg303085 - (view) Author: Zé Vinícius (Zé Vinícius) Date: 2017-09-27 00:40
Hi R. David Murray,

doctest compares strings, so "-0.0" is not the same as "0.0" to doctest

Thank you. That explains why "-0.0 == 0.0" is True to Python, but False to
doctest.

Cheers,
Zé

On Tue, Sep 26, 2017 at 5:35 PM, R. David Murray <report@bugs.python.org>
wrote:

>
> R. David Murray added the comment:
>
> To be clear: doctest compares strings, so "-0.0" is not the same as "0.0"
> to doctest.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue31599>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75780
2017-09-27 00:43:48r.david.murraysetstatus: open -> closed
resolution: not a bug
stage: resolved
2017-09-27 00:40:58Zé Viníciussetmessages: + msg303085
2017-09-27 00:35:58r.david.murraysetmessages: + msg303084
2017-09-27 00:35:00r.david.murraysetnosy: + r.david.murray
messages: + msg303083
2017-09-26 22:02:58Zé Viníciuscreate