Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indentation breaks for multiple statements separated by semicolons in class __init__ oneliner #680

Open
tandav opened this issue Mar 12, 2023 · 0 comments
Assignees

Comments

@tandav
Copy link

tandav commented Mar 12, 2023


Python Code

This is working python code:

class K:
    def __init__(self, x, *args, **kwargs): self.x = x; self.args = args; self.kwargs = kwargs

after running autopep8 it becomes:

class K:
    def __init__(self, x, *args, **
                 kwargs): self.x = x
    self.args = args
    self.kwargs = kwargs

Indentation is broken: "self" is not defined, "args" is not defined, "kwargs" is not defined.
Expected output should be something like this:

class K:
    def __init__(self, x, *args, **
                 kwargs): 
        self.x = x
        self.args = args
        self.kwargs = kwargs

Command Line and Configuration

Command Line

$ autopep8 --in-place main.py

Your Environment

  • Python version: python3.11
  • autopep8 version: 2.0.2
  • Platform: linux
@tandav tandav changed the title indentation breaks for multiple statements separated by commas in class __init__ oneliner indentation breaks for multiple statements separated by semicolons in class __init__ oneliner Mar 14, 2023
@hhatto hhatto self-assigned this Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants