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.

used_before_assignment_issue853.py 520B

1234567891011121314151617181920212223
  1. # pylint: disable=missing-docstring,bare-except,pointless-statement,superfluous-parens
  2. def strangeproblem():
  3. try:
  4. for _ in range(0, 4):
  5. message = object()
  6. print(type(message))
  7. finally:
  8. message = object()
  9. try:
  10. MY_INT = 1
  11. print("MY_INT = %d" % MY_INT)
  12. finally:
  13. MY_INT = 2
  14. try:
  15. pass
  16. except:
  17. FALSE_POSITIVE = 1
  18. FALSE_POSITIVE # here pylint claims used-before-assignment
  19. finally:
  20. FALSE_POSITIVE = 2 # this line is needed to reproduce the issue