I have a rather large project that I'm trying to clean up before posting, but when I run flake8 I get tons of
'F405 <function> may be undefined, or defined from star imports: generic_functions`
I could avoid this by replacing the line:
from generic_functions import *
at the start of my file, but:
I literally use all of the functions in there, so I don't understand how it's more pythonic to exceed the 80 character limit typing out every single function:
from generic_functions import (function1, function2, function3, function4, function5, function6, function7...)
Doing the above would be tedious, especially if I need to add or remove from the dozens of functions in generic_functions.py
The other option would be to disable the F405 warning, but what if the function is truly undefined? It would be nice to allow star imports while still catching anything undefined. Is there a way to do this? I tried adding # noqa to the import line, but it doesn't seem to help.
You can do the following:
from generic_functions import *
flake8 --ignore=F405 file.py
. I really don't know why # noqa
doesn't work, but --ignore
does.<function>
is defined and imported from generic_functions
.