Invert Boolean
This refactoring aims to flip the value of a Boolean variable and all its usages from True to False and vice versa.
Example
Before | After |
---|---|
def foo{}:
abc<caret here> = True
return abc |
def foo{}:
abc = False
return not abc |
To invert a Boolean variable, follow these steps
See Also
Reference:
Last modified: 30 August 2016