Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

compare_to_zero.py 442B

12345678910111213141516171819202122232425262728
  1. # pylint: disable=literal-comparison,missing-docstring,misplaced-comparison-constant
  2. X = 123
  3. Y = len('test')
  4. if X is 0: # [compare-to-zero]
  5. pass
  6. if Y is not 0: # [compare-to-zero]
  7. pass
  8. if X == 0: # [compare-to-zero]
  9. pass
  10. if Y != 0: # [compare-to-zero]
  11. pass
  12. if X > 0: # [compare-to-zero]
  13. pass
  14. if X < 0: # this is allowed
  15. pass
  16. if 0 < X: # [compare-to-zero]
  17. pass
  18. if 0 > X: # this is allowed
  19. pass