You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was only formally added to the language spec in Python 3.10. However, it was (initially only accidentally) made valid syntax in Python 3.9. This definitely isn't going to be reverted in CPython, so it's entirely safe to assume that with items can be parenthesized on Python 3.9. Black also uses parenthesized with items on Python 3.9, and I think it's good for us to be consistent with Black here. (Actually this was recently discussed again at psf/black#4488, but they decided to keep their current behaviour.)
Is this behaviour causing an issue for you somewhere? :-)
Formatting the following code with
target-version
set to"py39"
andline-length
set to10
(just for the example):Expected output similar to:
Actual output:
Playground
Support for using grouping parentheses to break the
with
statement in multiple lines was added in version 3.10, see: https://docs.python.org/3/reference/compound_stmts.html#the-with-statementThe text was updated successfully, but these errors were encountered: