[Python-ideas] PEP 485: A Function for testing approximate equality

Nick Coghlan ncoghlan at gmail.com
Mon Jan 26 15:14:15 CET 2015


On 27 January 2015 at 00:08, Nick Coghlan <ncoghlan at gmail.com> wrote:
> The "places=N" argument could also potentially be adjusted to be a
> shorthand for "delta=10e-N" rather than its current definition.

And for folks worried about the slight backwards compatibility break
here: "the unittest.TestCase.assertAlmostEqual fuzzy equality function
is now slightly less fuzzy if you're using the 'places' argument" is
well within the scope of the kind of thing we're prepared to cover in
the "Porting Notes" section of the What's New docs.

The impact of such a change could also be mitigated by changing the
default value so that the default behaviour of the new definition
resulted in approximately the same absolute delta as the old
definition.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list