Place list items on a new line

Answered

Hi,

Is it possible to tell PyCharm to format lists so that each item appears on an individual line instead of bunching them up as far as the line limit.

eg. 

If I reformatted this: 

PyCharm yields this:

but what I want is this:

3 comments
Comment actions Permalink

Hi Shayan! Sorry for a late reply.

Nope, unfortunately, such option exists only for dict literals now (Code Style | Python | Wrapping and Braces | Dictionary literals | Wrap always/Chop down if long). Could you please create a feature request about it in our tracker? I'll try to schedule it for the next release.

0
Comment actions Permalink

Mikhail Golubev, thank you! It helps me with dicts :).

0
Comment actions Permalink

BTW, there is now a dedicated feature request about wrapping settings for list literals: https://youtrack.jetbrains.com/issue/PY-31689.

0

Please sign in to leave a comment.