Skip to content
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

'sorted' from python 2.4 or 2.5 makes test on 'utils.histogram' fail #2

Closed
GoogleCodeExporter opened this issue Apr 10, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

1) What steps will reproduce the problem?

$ python2.4 doctests.py -v utils.py

or

$ python2.5 doctests.py -v utils.py

2) What is the expected output? What do you see instead?

Failed example:
    histogram(vals, 1) 
Expected:
    [(200, 3), (110, 2), (160, 2), (220, 1), (100, 1)]
Got:
    [(200, 3), (160, 2), (110, 2), (100, 1), (220, 1)]

3) What version of the product are you using? On what operating system?

* Code from SVN repository.
* Debian GNU/Linux (Sid, up-to-date).

4) Please provide any additional information below.

It looks like python's sorted in 2.4 or 2.5 doesn't work exactly as the one
supplied (but I can't try that because I haven't got 2.3, and on 2.4 it
doesn't work).

I'm sure this is not a bug, but maybe you're interested in having
successful tests also on python >= 2.4.

Sorry for such a useless report, otherwise. :-)

Original issue reported on code.google.com by matteo.a...@gmail.com on 1 Oct 2007 at 2:23

@GoogleCodeExporter
Copy link
Author

This is really a bug in the test, not the code.  Both the "Expected" and "Got"
answers are acceptable -- they both give the 3 value first, then the 2 values, 
then
the 1 values.  They differ on how they break ties, which is acceptable.  I 
should
rewrite the test so that it does not depend on breaking ties one way or the 
other.

Original comment by peter.no...@gmail.com on 1 Oct 2007 at 3:40

@GoogleCodeExporter
Copy link
Author

Changed the test and the code for histogram to return consistent results across
different Python versions.

Original comment by peter.no...@gmail.com on 25 Nov 2007 at 11:06

  • Changed state: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant