Hide warning in PyCharm

Aug. 9, 2016, 4:43 a.m.

Warning: might be referenced before assignment

Use # noinspection PyUnboundLocalVariable, for example:

def get_rate(self, rates, amount):
    for rate_item in rates:
        if amount <= rate_item.amount:
            return rate_item.rate

    # noinspection PyUnboundLocalVariable
    return rate_item.rate

Warning: unexpected argument

Use # noinspection PyArgumentList, for example:

# noinspection PyArgumentList
product = Cloth(product_name='title',product_code='xxx', unit_price=120)

Available identifiers for hiding of warning in PyCharm

In common case, write down # noinspection [warning identifier] before warning row.

# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList  # unexpected argument
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit
# noinspection PyAugmentAssignment
# noinspection PyBroadException
# noinspection PyByteLiteral
# noinspection PyCallByClass
# noinspection PyCallingNonCallable
# noinspection PyChainedComparisons
# noinspection PyClassHasNoInit
# noinspection PyClassicStyleClass
# noinspection PyComparisonWithNone
# noinspection PyCompatibility
# noinspection PyDecorator
# noinspection PyDefaultArgument
# noinspection PyDeprecatedModules
# noinspection PyDeprecation
# noinspection PyDictCreation
# noinspection PyDictDuplicateKeys
# noinspection PyDocstring
# noinspection PyDocstringTypes
# noinspection PyExceptClausesOrder
# noinspection PyExceptionInherit
# noinspection PyFromFutureImport
# noinspection PyGlobalUndefined
# noinspection PyInconsistentIndentation
# noinspection PyInitNewSignature
# noinspection PyInterpreter
# noinspection PyListCreation
# noinspection PyMandatoryEncoding
# noinspection PyMethodFirstArgAssignment
# noinspection PyMethodMayBeStatic
# noinspection PyMethodOverriding
# noinspection PyMethodParameters
# noinspection PyMissingConstructor
# noinspection PyNestedDecorators
# noinspection PyNonAsciiChar
# noinspection PyNoneFunctionAssignment
# noinspection PyOldStyleClasses
# noinspection PyPackageRequirements
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyPropertyAccess
# noinspection PyPropertyDefinition
# noinspection PyProtectedMember
# noinspection PyRaisingNewStyleClass
# noinspection PyRedeclaration
# noinspection PyRedundantParentheses
# noinspection PyReturnFromInit
# noinspection PySetFunctionToLiteral
# noinspection PyShadowingBuiltins
# noinspection PyShadowingNames
# noinspection PySimplifyBooleanCheck
# noinspection PySingleQuotedDocstring
# noinspection PyStatementEffect
# noinspection PyStringException
# noinspection PyStringFormat
# noinspection PySuperArguments
# noinspection PyTrailingSemicolon
# noinspection PyTupleAssignmentBalance
# noinspection PyTupleItemAssignment
# noinspection PyTypeChecker
# noinspection PyUnboundLocalVariable  # might be referenced before assignment
# noinspection PyUnnecessaryBackslash
# noinspection PyUnreachableCode
# noinspection PyUnresolvedReferences  # in try block with 'except ImportError' should also be defined in except block
# noinspection PyUnsupportedFeatures
# noinspection PyUnusedLocal

Rate this article

5 from 5 (total 1 rating)

You can send feedback, suggestions or comments on this article using this form:

Fields marked by star ( * ) is required.

Thank you for yor feedback!

After clicking the "Send" button, your message will be delivered to me on the mail.

Author of Article

Artem Maltsev

Web-developer, having the knowlenge of programming language - Python, framework - Django, content management system - Django CMS, platform of e-commerce site - Django Shop and many other applications, using this technologies.

The right to use content on this page https://vivazzi.pro/it/hide-warning-in-pycharm/:

Permission is granted to copy an content with its author and reference to the original without using the parameter rel="nofollow" in tag <a>. Usage:

Author of Article: Artem Maltsev
Link to article: <a href="https://vivazzi.pro/it/hide-warning-in-pycharm/">https://vivazzi.pro/it/hide-warning-in-pycharm/</a>

More: Terms of site usage

Related Posts:

Comments: 2

Z
Z

13.01.2018 21:42 #

А как скрыть предупреждения сразу ко всем строкам в модуле?

Reply

Артём Мальцев
Артём Мальцев author

14.01.2018 1:43 #

Здравствуйте, вы можете зайти в меню: File -> Settings и в открывшимся окне перейти на вкладку Editor -> Inspections и снять галочки в нужных пунктах.

Reply

You can leave a comment as an unregistered user.

But if you sing up, you can:

  • receive notifications
  • view your comments
  • be able to use all the functions of the developed services

To comment in one's own name you should log in or sign up on Vuspace website

Send

There is no search on this site, so I offer to use usual search engine, for example, Google, adding "vivazzi" after your request.

Try it

Select currency for displaying monetary values