How to break a long with statement in python -


i have line of code in python this:

with long_name_function(p) a, other_long_name_function(): 

and want break in multiple lines, because long, use backslashes, considered bad practice. use contextlib.nested, deprecated, there other alternative?

this disregards premise of question recommend using backslashes in case:

with really_really_long_name_function(p) f1, \         other_really_really_long_name_function() f2:     pass 

as @jonclements said, can't use brackets or commas in case, there's no alternative backslashes way go , code looks pretty clean imo.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -