Can I get PyCharm to suppress a particular warning on a single line?
<p>PyCharm provides some helpful warnings on code style, conventions and logical gotchas. It also provides a notification if I try to commit code with warnings (or errors).</p>

<p>Sometimes I consciously ignore these warnings for particular lines of code (for various reasons, typically to account for implementation details of third-party libraries). I want to suppress the warning, but just for that line (if the warning crops up on a different line where I'm not being deliberate, I want to know about it!)</p>

<p>How can I do that in PyCharm? (Following a universal Python convention strongly preferable.)</p>

<p>Essentially, for the file in which you want to suppress the warning, run it through code inspection, post which PyCharm will give you warnings in that particular file. You can then review the warnings and tell PyCharm to suppress warning for a particular statement.</p>

<p>Code Inspection can be accessed from Code-->Inspect Code menu from where you can select the file that you want to inspect.</p>

<p>Below is an image that shows how to do it for an image, after running code via CodeInspection
<a href="https://i.stack.imgur.com/erFCc.png" rel="nofollow"><img src="https://i.stack.imgur.com/erFCc.png" alt="Code Inspection Output"></a></p>

<p>Link for more details around suppressing warnings: <a href="https://www.jetbrains.com/help/pycharm/2016.1/suppressing-inspections.html#1" rel="nofollow">https://www.jetbrains.com/help/pycharm/2016.1/suppressing-inspections.html#1</a></p>

python pycharm compiler-warnings suppress-warnings