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.

confusing_with_statement.py 644B

123456789101112131415161718192021222324252627
  1. # pylint: disable=undefined-variable,not-context-manager,missing-docstring
  2. # both context managers are named
  3. with one as first, two as second:
  4. pass
  5. # first matched as tuple; this is ok
  6. with one as (first, second), third:
  7. pass
  8. # the first context manager doesn't have as name
  9. with one, two as second:
  10. pass
  11. # the second is a function call; this is ok
  12. with one as first, two():
  13. pass
  14. # nested with statements; make sure no message is emitted
  15. # this could be a false positive on Py2
  16. with one as first:
  17. with two:
  18. pass
  19. # ambiguous looking with statement
  20. with one as first, two: # [confusing-with-statement]
  21. pass