Code style in PyCharm for python (wrapping/chopping long lines)

Answered

I like using annotations and my code often exceeds 79 characters  when there are 3+ parameters in a function. So I find it way more readable to chop such parameters instead of wrapping (foo_chopped style (below) is preferable to me):

 


def foo(param1: Dict[str, Any], param2: List[str], param3: List[float]) -> bool:
    pass

def foo_wrapped(param1: Dict[str, Any],
param2: List[str], param3: List[float]) -> bool:
    pass
def foo_chopped(
param1: Dict[str, Any],
param2: List[str],
param3: List[float]) -> bool:
    pass

 

Unfortunately, I can't find this in settings->Editor->Code Style->Python. Is there any plug-in or solution for that? 

2 comments

Hi Aafriit,

There is no such feature at the moment. 

Please feel free to submit a feature request about it to our issue tracker using the link https://youtrack.jetbrains.com/issues/PY.

1

Please sign in to leave a comment.