lundi 5 avril 2021

Can I combine if and with statements in a single line?

I've a code block as follows:

if condition:
    with something as another_thing:
        // do my stuff here

I don't like this style due to multiple indentations. Can I combine if and with statements in a single line somehow, and reduce the indentation?

Aucun commentaire:

Enregistrer un commentaire