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.

not_in_loop.py 849B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. """Test that not-in-loop is detected properly."""
  2. # pylint: disable=missing-docstring, invalid-name, too-few-public-methods
  3. # pylint: disable=useless-else-on-loop, using-constant-test
  4. while True:
  5. def ala():
  6. continue # [not-in-loop]
  7. while True:
  8. pass
  9. else:
  10. continue # [not-in-loop]
  11. def lala():
  12. continue # [not-in-loop]
  13. while True:
  14. class A(object):
  15. continue # [not-in-loop]
  16. for _ in range(10):
  17. pass
  18. else:
  19. continue # [not-in-loop]
  20. for _ in range(42):
  21. pass
  22. else:
  23. break # [not-in-loop]
  24. if True:
  25. continue # [not-in-loop]
  26. else:
  27. break # [not-in-loop]
  28. for _ in range(10):
  29. for _ in range(20):
  30. pass
  31. else:
  32. continue
  33. while True:
  34. while True:
  35. break
  36. else:
  37. break
  38. break
  39. else:
  40. pass
  41. for _ in range(1):
  42. continue
  43. for _ in range(42):
  44. break