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

Multiple assignment target + comprehension causes code to disappear #1

Open
lars447 opened this issue Apr 26, 2024 · 0 comments
Open

Comments

@lars447
Copy link

lars447 commented Apr 26, 2024

Hi,
I've been playing around with your tool and noticed a potential issue.
When in adjacent lines the multiple assignment transformation is performed followed by a comprehension tranformation, the multiple assignments are correctly merged into a single line multi assignment. However, the code that would have been transformed into the comprehension simply dissapears (messing up the indentation in the process).

Example

def solve(self):
    provider = Provider(self._package, self._pool, self._io)
    locked = {}
    for package in self._locked.packages:
        locked[package.name] = package
    return locked

Expected Outcome

def solve(self):
    provider, locked = Provider(self._package, self._pool, self._io), {package.name: package for package in self._locked.packages}
    return locked

Actual Outcome

def solve(self):
    provider , locked  = Provider(self._package, self._pool, self._io), {}
        return locked

Best,
Lars

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

1 participant