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

Antoine Pitrou solipsis at pitrou.net
Mon Jan 26 22:08:55 CET 2015


On Mon, 26 Jan 2015 12:14:04 -0800
Ethan Furman <ethan at stoneleaf.us> wrote:
> On 01/26/2015 11:37 AM, Antoine Pitrou wrote:
> > On Mon, 26 Jan 2015 11:26:59 -0800
> > Chris Barker <chris.barker at noaa.gov> wrote:
> >>
> >>> Simplicity has its virtues.
> >>
> >> But which is more simple? I came to the conclusion that the asymmetric was
> >> simpler to explain and reason about in any case.
> > 
> > Symmetricity removes any uncertainty as to parameter order.
> 
> Yes, and nothing is simpler than getting wrong answers -- I can generate those all day long without even trying!  ;)
> 
> One example of when it matters:
> 
>   resistors should have a value of 10, but can be off by 2.5%

This is the kind of test that's extremely easy to write by hand. I
don't know why you would need the stdlib's help for that.

Regards

Antoine.




More information about the Python-ideas mailing list