Search code examples
python-3.xpycharmcode-inspection

How to suppress code inspection in PyCharm?


Throughout my code I have numerous places where I want to disable PyCharm code inspection for this one instance. How to do it in code instead of in IDE as answer to similar question suggests?


Solution

  • To suppress PyCharm code inspections for a particular line of code you can use the following construct:

    # noinspection INSPECTION_NAME
    your_line_of_code_to_suppress
    

    where the name of the inspection you can take from the list of inspection names (they are pretty descriptive).