My Python Flask application contains a lot of route definitions like
@app.route('/')
def index():
Then pylint complains
W: 72, 4: Unused variable 'index' (unused-variable)
which is technically correct. I can't replace all the function names by _
, say, because then Flask complains
AssertionError: View function mapping is overwriting an existing endpoint function: _
I could replace all the handler function names with their underscore-prefixed equivalents, i.e. change index
to _index
, etc.. Is there another idiomatic way of dealing with this problem?
I tried to use pylint_flask, but it doesn't work.
pylint --load-plugins pylint_flask makerpose/appserver.py
Adding _
in front of methods' names solves the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With