hadialqattan / pycln

A formatter for finding and removing unused import statements.

Home Page:https://hadialqattan.github.io/pycln

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE] Remove unused explicit imports from modules that (may) have side-effects

Avasam opened this issue · comments

Describe the solution you'd like A clear and concise description of what you want to
happen.

If side-effects cannot be analysed (or are analyzed as "maybe"), could pycln still remove unused explicit imports?
ie:

from c_module import used, unused
# to
from c_module import used


from c_module import unused
# to
import c_module

Describe alternatives you've considered A clear and concise description of any
alternative solutions or features you've considered.

For now I # nopycln: import those lines (and/or add the c-modules to the exclude list).

Additional context Add any other context or screenshots about the feature request
here.

Came from the following comments: #182 (comment)