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
Related Posts:
Comments: 2
13.01.2018 21:42 #
А как скрыть предупреждения сразу ко всем строкам в модуле?
Reply
14.01.2018 1:43 #
Здравствуйте, вы можете зайти в меню: File -> Settings и в открывшимся окне перейти на вкладку Editor -> Inspections и снять галочки в нужных пунктах.
Reply