Re: Inverting a conditional function

2018-06-09 Thread Terry Reedy
On 6/9/2018 5:54 AM, Steven D'Aprano wrote: I frequently have a function which tests some condition, returning True or False, and want a function which reverses the condition. If all I wanted was the result of calling the function, I could say not condition(x) and be done with it, but I w

Inverting a conditional function

2018-06-09 Thread Steven D'Aprano
I frequently have a function which tests some condition, returning True or False, and want a function which reverses the condition. If all I wanted was the result of calling the function, I could say not condition(x) and be done with it, but I want a new function. I've been doing this: