strip-hints
strip-hints copied to clipboard
Remove "typing" imports
If the hints are removed, the typing
import should no longer be needed, except for programs which rely upon typing
and probably are unsuitable for stripping of hints.
In most cases all the typing
imports could be stripped, but there isn't any easy way to strip them out and maintain guaranteed program correctness (like when just stripping hints). There are other tools out there that can remove unneeded imports which a user could run after stripping hints. So I'm not inclined to add this feature to the program.
I am using autoflake --remove-all-unused-imports
to do this, however it is more invasive than I want. The benefit of this enhancement is that it would remove only the typing
imports. Anyway, I appreciate it isnt a high priority.
Another brutal dependency-free workaround:
sed -i '/^from typing/d' *.py