comparison-of-constants / R0133#
Comparison between constants: '%s %s %s' has a constant value
When two literals are compared with each other the result is a constant. Using the constant directly is both easier to read and more performant. Initializing 'True' and 'False' this way is not required since Python 2.3.
def is_the_answer() -> bool: return 42 == 42 # [comparison-of-constants]
def is_the_answer(meaning_of_life: int) -> bool: return meaning_of_life == 42
Created by the basic checker.