ruff/crates/ruff_python_parser/resources/valid/statement/with.py

14 lines
361 B
Python

# This file only contains unparenthesized with items. Refer to ./ambiguous_lpar_with_items.py
# for parenthesized with items test cases
with item: ...
with item as f: ...
with item1, item2: ...
with item1 as f1, item2 as f2: ...
with x if True else y: ...
with x if True else y as f: ...
# Postfix expressions
with open() as f: ...
with open() as f.attr: ...