unimport
unimport copied to clipboard
Import after use gets removed
trafficstars
With 0.7.4 and --remove --include-star-import --ignore-init --gitignore
In code like this
def bob():
print(sys.path)
import sys
The import gets incorrectly removed.
You might reasonably ask why I even had code like this, in larger files my work flow is to just drop imports in the nearest bit of module level scope and let unimport and isort clean it up.
Unimport is currently using primary analysis methods, this problem will be solved if scope analysis is added.