-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow float comparison in dicts #186
Conversation
Before this PR, floating numbers in arrays are compared as floating numbers, but floating numbers in dicts are not, because they end on "}". This PR simply adds "}" to the regexp that determines what can be at the end of a floating number to allows for doctests like >>> x = {'a': 1/3., 'b': 2/3.} >>> x # doctest: +FLOAT_CMP {'a': 0.333333, 'b': 0.666666} which failed before this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooo I didn't even know you can do this.
Do you need a new release?
[ci skip]
CI was disabled due to inactivity. I am closing/reopening to trigger proper CI. |
I have not been following this repro, so I don't know how much development is happening. On the one hand, it seems a lot to to a release for exactly one added character in the code base excluding tests and changelogs [*], on the other hand, in sherpa/sherpa#1521 (comment) I've already decided to "just let my dict-comparison fail until pytest-doctestplus has a new release". *: But I'm happy to compete for ""Smallest change that got it's own release |
No other PRs are open and I don't see anyone fixing other issues anytime soon... |
@saimn , what do you think? Do we do a new release now? |
I guess we can, it's supposed to be as simple as pushing a new tag :) |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks ! |
More fixes and issues to come as we tests for upstream usability, but even then, doing incremental small releases is good. |
Before this PR, floating numbers in arrays are compared as floating numbers, but floating numbers in dicts are not, because they end on "}". This PR simply adds "}" to the regexp that determines what can be at the end of a floating number to allows for doctests like
which failed before this PR.