How to disable fake pylint warning for multiline string

How can I disable spurious pylint warning for a multi-line string for that line only?

The first disables the operation, the second (false warning) does not.

Edited after the original answer for a simpler example.

#!/usr/bin/env python

print 0!= 1 # pylint: disable=C0322
print {''
# pylint: disable=C0322
: '''%      
'''
# pylint: enable=C0322
}

      

I get

************* Module foobar
C0322:  4: Operator not preceded by a space
print {''

: '''%
     ^

      

+3


source to share


1 answer


you can do something like



# pylint: disable=C0322
print 0!= 1
print '''%
'''
# pylint: enable=C0322

      

+2


source







All Articles