[Python-Dev] fcmp() in test.support

Brett Cannon brett at python.org
Fri Jan 28 19:09:12 CET 2011


On Thu, Jan 27, 2011 at 20:55, Eli Bendersky <eliben at gmail.com> wrote:
> I'm working on improving the .rst documentation of test.support (Issue
> 11015), and came upon the undocumented "fcmp" function that's being
> exported from test.support, along with a "FUZZ"constant.
>
> As I search through the tests (py3k trunk), I see fcmp() is being used
> only in two places in a fairly trivial way:
> 1. test_float: where it can be directly replaced by assertAlmostEqual
> from unittest
> 2. test_builtin: where the assertion can also be easily rewritten in
> terms of assertAlmostEqual
>
> Although fcmp seems to provide extra functionality over
> assertAlmostEqual, the above makes me think it should probably be
> removed altogether, or added to unittest if it's still deemed
> important.
>
> +/- ?

I say drop it if it can be done so safely.


More information about the Python-Dev mailing list