Pythons implementation of the with statement. Examples: with feature_flag_enabled(…): # code block with open(“file.txt”) as file: # code block with (context_manager1 as var1, context_manager2 as var2, context_manager3 as var3): # code block
str
str
int
bool
str
str
bool, optional
bool
Editable
with new_src
.
str
bool
int
bool
None
Union[list[str], str]
bool
list[str]
bool
str
bool
str
bool, optional
bool, optional
int, optional
bool, optional
None
str
bool
bool
int
bool
None
bool
bool
None
bool
int
bool
None
str
str
int, optional
bool, optional
int, optional
int
regex_pattern
, similar to python’s re.search().
str
bool
bool
str
bool, optional
bool, optional
bool, optional
None