Skip to content

Multiple star imports with clashing names #121

@isik-kaplan

Description

@isik-kaplan
from _collections import *
from collections import *

print(defaultdict)

Unimport works fine when it comes to finding the correct import module for the variables, but this doesn't help when it comes to clashing names.

The problem can be avoided by running unimport twice with the -r flag, allowing it to turn the above into

from _collections import defaultdict
from collections import defaultdict

and then running again to remove the first unused import, but I think it should be able to do it in a single run without needing to run in twice.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingchangelogChanges should be written to the changelog file.

Projects

Status

📋 Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions