I am hosting IronPython inside a C# application and injecting an API for the host into the global scope.
I have just started to love syntastic
for vim with pylint
for checking my scripts. But I am getting annoyed by all the [E0602, method_name] Undefined variable 'variable_name'
error messages for the injected variables.
I am aware of using # pylint: disable=E0602
to disable this error message, but I'd prefer not to cripple a really useful feature just for some specific variable names.
How do you deal with this?
Currently, I am doing this at the top of my script:
try:
host_object = getattr(__builtins__, 'host_object')
except AttributeError:
pass # oops, run this script inside the host application!!
What I would really like to do is this:
# pylint: declare=host_object, other_stuff
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…