Confused about singleton-comparison suggestion by pylint
For the given code def greater(n): if n > 3: res = True else: res = False return res a = greater(5) print(hex(id(a))) print(hex(id(True))) b = True print(hex(id(b))) if a == True: print(‘yes’) else: print(‘no’) pylint suggests pylint_example.py:16:4: C0121: Comparison ‘a == True’ should be ‘a is True’ if checking for the singleton value True,… Read More Confused about singleton-comparison suggestion by pylint