Python Coding Standard
Python Coding Standard
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 1/41
2024/11/27 下午6:59 Python Coding Standard
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 2/41
2024/11/27 下午6:59 Python Coding Standard
Change History
1.0 2023-02-15
Initial import. Generated Coding Standard from
https://pylint.readthedocs.io
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 3/41
2024/11/27 下午6:59 Python Coding Standard
Convention
C0103
Synopsis Used when the name doesn't conform to naming rules associated to its type
Level 3
Category Convention
Status Checked
C0112
Synopsis Used when a module, function, class or method has an empty docstring
Level 3
Category Convention
Status Checked
C0113
Synopsis Used when a boolean expression contains an unneeded negation.
Level 5
Category Convention
Status Checked
C0114
Synopsis Missing module docstring
Level 3
Category Convention
Status Checked
C0115
Synopsis Missing class docstring
Level 3
Category Convention
Status Checked
C0116
Synopsis Missing function or method docstring
Level 3
Category Convention
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 4/41
2024/11/27 下午6:59 Python Coding Standard
C0123
Synopsis Use isinstance() rather than type() for a typecheck.
Level 5
Category Convention
Status Checked
C0198
Synopsis Used when a docstring does not have triple double quotes.
Level 5
Category Convention
Status Checked
C0199
Synopsis Used when a blank line is found at the beginning of a docstring.
Level 5
Category Convention
Status Checked
C0200
Synopsis Consider using enumerate instead of iterating with range and len
Level 5
Category Convention
Status Checked
C0201
Synopsis Consider iterating the dictionary directly instead of calling .keys()
Level 5
Category Convention
Status Checked
C0202
Used when a class method has a first argument named differently than the value
Synopsis
specified in valid-classmethod-first-arg option
Level 3
Category Convention
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 5/41
2024/11/27 下午6:59 Python Coding Standard
C0203
Used when a metaclass method has a first argument named differently than the
Synopsis
value specified in valid-classmethod-first-arg option
Level 3
Category Convention
Status Checked
C0204
Used when a metaclass class method has a first argument named differently than
Synopsis
the value specified in valid-metaclass-classmethod-first-arg option
Level 5
Category Convention
Status Checked
C0205
Synopsis Class __slots__ should be a non-string iterable
Level 1
Category Convention
Status Checked
C0325
Synopsis Used when a single item in parentheses follows an if, for, or other keyword.
Level 5
Category Convention
Status Checked
C0327
Synopsis Mixed line endings LF and CRLF
Level 5
Category Convention
Status Checked
C0328
Synopsis Used when there is different newline than expected.
Level 5
Category Convention
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 6/41
2024/11/27 下午6:59 Python Coding Standard
C0401
Synopsis Used when a word in comment is not spelled correctly.
Level 5
Category Convention
Status Checked
C0402
Synopsis Used when a word in docstring is not spelled correctly.
Level 5
Category Convention
Status Checked
C0403
Synopsis Used when a word in docstring cannot be checked by enchant.
Level 5
Category Convention
Status Checked
C0411
Synopsis Used when PEP8 import order is not respected
Level 5
Category Convention
Status Checked
C0412
Synopsis Used when imports are not grouped by packages.
Level 5
Category Convention
Status Checked
C0413
Synopsis Used when code and imports are mixed.
Level 5
Category Convention
Status Checked
C0414
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 7/41
2024/11/27 下午6:59 Python Coding Standard
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 8/41
2024/11/27 下午6:59 Python Coding Standard
Error
E0100
Synopsis __init__ method is a generator
Level 1
Category Error
Status Checked
E0101
Synopsis Explicit return in __init__
Level 1
Category Error
Status Checked
E0102
Synopsis Used when a function / class / method is redefined.
Level 1
Category Error
Status Checked
E0110
Synopsis Used when an abstract class with `abc
Level 5
Category Error
Status Checked
E0111
Synopsis The first reversed() argument is not a sequence
Level 5
Category Error
Status Checked
E0113
Synopsis Starred assignment target must be in a list or tuple
Level 5
Category Error
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 9/41
2024/11/27 下午6:59 Python Coding Standard
E0114
Synopsis Can use starred expression only in assignment target
Level 5
Category Error
Status Checked
E0115
Synopsis Emitted when a name is both nonlocal and global.
Level 5
Category Error
Status Checked
E0117
Emitted when a nonlocal variable does not have an attached name somewhere in
Synopsis
the parent scopes
Level 5
Category Error
Status Checked
E0202
Used when a class defines a method which is hidden by an instance attribute from
Synopsis
an ancestor class or set by some client code
Level 1
Category Error
Status Checked
E0203
Synopsis Used when an instance member is accessed before it's actually assigned.
Level 1
Category Error
Status Checked
E0211
Used when a method which should have the bound instance as first argument has
Synopsis
no argument defined
Level 1
Category Error
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 10/41
2024/11/27 下午6:59 Python Coding Standard
Status Checked
E0213
Synopsis Used when a method has an attribute different the "self" as first argument
Level 1
Category Error
Status Checked
E0236
Synopsis Used when an invalid (non-string) object occurs in __slots__.
Level 5
Category Error
Status Checked
E0237
Synopsis Used when assigning to an attribute not defined in the class slots.
Level 5
Category Error
Status Checked
E0238
Synopsis Invalid __slots__ object
Level 5
Category Error
Status Checked
E0239
Synopsis Used when a class inherits from something which is not a class.
Level 5
Category Error
Status Checked
E0240
Synopsis Used when a class has an inconsistent method resolution order.
Level 5
Category Error
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 11/41
2024/11/27 下午6:59 Python Coding Standard
E0241
Synopsis Duplicate use of base classes in derived classes raise TypeErrors.
Level 5
Category Error
Status Checked
E0301
Synopsis __iter__ returns non-iterator
Level 5
Category Error
Status Checked
E0302
Synopsis Emitted when a special method was defined with an invalid number of parameters
Level 5
Category Error
Status Checked
E0303
Synopsis __len__ does not return non-negative integer
Level 5
Category Error
Status Checked
E0312
Synopsis __getnewargs__ does not return a tuple
Level 1
Category Error
Status Checked
E0401
Synopsis Used when pylint has been unable to import a module.
Level 5
Category Error
Status Checked
E0402
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 12/41
2024/11/27 下午6:59 Python Coding Standard
E0601
Synopsis Emitted when a local variable is accessed before its assignment took place
Level 1
Category Error
Status Checked
E0602
Synopsis Used when an undefined variable is accessed.
Level 1
Category Error
Status Checked
E0603
Synopsis Used when an undefined variable name is referenced in __all__.
Level 5
Category Error
Status Checked
E0604
Synopsis Used when an invalid (non-string) object occurs in __all__.
Level 5
Category Error
Status Checked
E0611
Synopsis Used when a name cannot be found in a module.
Level 1
Category Error
Status Checked
E0701
Synopsis Used when except clauses are not in the correct order
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 13/41
2024/11/27 下午6:59 Python Coding Standard
Level 1
Category Error
Status Checked
E0702
Synopsis Used when something which is neither a class nor an instance is raised
Level 1
Category Error
Status Checked
E0704
Synopsis The raise statement is not inside an except clause
Level 5
Category Error
Status Checked
E0710
Synopsis Raising a new style class which doesn't inherit from BaseException
Level 5
Category Error
Status Checked
E0711
Synopsis NotImplemented raised - should raise NotImplementedError
Level 5
Category Error
Status Checked
E0712
Used when a class which doesn't inherit from Exception is used as an exception in
Synopsis
an except clause
Level 5
Category Error
Status Checked
E1003
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 14/41
2024/11/27 下午6:59 Python Coding Standard
Used when another argument than the current class is given as first argument of
Synopsis
the super builtin
Level 1
Category Error
Status Checked
E1101
Synopsis Used when a variable is accessed for a nonexistent member.
Level 1
Category Error
Status Checked
E1102
Synopsis Used when an object being called has been inferred to a non callable object.
Level 1
Category Error
Status Checked
E1111
Synopsis Assigning result of a function call, where the function has no return
Level 1
Category Error
Status Checked
E1120
Synopsis Used when a function call passes too few arguments.
Level 5
Category Error
Status Checked
E1121
Synopsis Used when a function call passes too many positional arguments.
Level 5
Category Error
Status Checked
E1123
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 15/41
2024/11/27 下午6:59 Python Coding Standard
Used when a function call passes a keyword argument that doesn't correspond to
Synopsis
one of the function's parameter names
Level 5
Category Error
Status Checked
E1124
Used when a function call would result in assigning multiple values to a function
Synopsis parameter, one value from a positional argument and one from a keyword
argument
Level 5
Category Error
Status Checked
E1125
Synopsis Used when a function call does not pass a mandatory keyword-only argument.
Level 5
Category Error
Status Checked
E1127
Synopsis Slice index is not an int, None, or instance with __index__
Level 5
Category Error
Status Checked
E1130
Emitted when a unary operand is used on an object which does not support this
Synopsis
type of operation
Level 5
Category Error
Status Checked
E1131
Emitted when a binary arithmetic operation between two operands is not
Synopsis
supported
Level 5
Category Error
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 16/41
2024/11/27 下午6:59 Python Coding Standard
Status Checked
E1132
Synopsis Emitted when a function call got multiple values for a keyword.
Level 5
Category Error
Status Checked
E1135
Emitted when an instance in membership test expression doesn't implement
Synopsis
membership protocol
Level 5
Category Error
Status Checked
E1137
Synopsis Emitted when an object does not support item assignment
Level 5
Category Error
Status Checked
E1138
Synopsis Emitted when an object does not support item deletion
Level 5
Category Error
Status Checked
E1139
Emitted whenever we can detect that a class is using, as a metaclass, something
Synopsis
which might be invalid for using as a metaclass
Level 1
Category Error
Status Checked
E1200
Used when an unsupported format character is used in a logging statement
Synopsis
format string
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 17/41
2024/11/27 下午6:59 Python Coding Standard
Level 5
Category Error
Status Checked
E1201
Synopsis Logging format string ends in middle of conversion specifier
Level 5
Category Error
Status Checked
E1205
Synopsis Too many arguments for logging format string
Level 5
Category Error
Status Checked
E1206
Synopsis Not enough arguments for logging format string
Level 5
Category Error
Status Checked
E1300
Synopsis Used when an unsupported format character is used in a format string.
Level 5
Category Error
Status Checked
E1301
Synopsis Format string ends in middle of conversion specifier
Level 5
Category Error
Status Checked
E1302
Synopsis Mixing named and unnamed conversion specifiers in format string
Level 5
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 18/41
2024/11/27 下午6:59 Python Coding Standard
Category Error
Status Checked
E1303
Used when a format string that uses named conversion specifiers is used with an
Synopsis
argument that is not a mapping
Level 5
Category Error
Status Checked
E1304
Used when a format string that uses named conversion specifiers is used with a
Synopsis
dictionary that doesn't contain all the keys required by the format string
Level 5
Category Error
Status Checked
E1305
Synopsis Too many arguments for format string
Level 5
Category Error
Status Checked
E1306
Synopsis Not enough arguments for format string
Level 5
Category Error
Status Checked
E1307
Used when a type required by format string is not suitable for actual argument
Synopsis
type
Level 1
Category Error
Status Checked
E1310
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 19/41
2024/11/27 下午6:59 Python Coding Standard
E1507
Synopsis Env manipulation functions support only string type arguments
Level 1
Category Error
Status Checked
E1700
Synopsis Yield inside async function
Level 5
Category Error
Status Checked
E1701
Used when an async context manager is used with an object that does not
Synopsis
implement the async context management protocol
Level 5
Category Error
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 20/41
2024/11/27 下午6:59 Python Coding Standard
Fatal
F0202
Used when Pylint has been unable to check methods signature compatibility for
Synopsis
an unexpected reason
Level 5
Category Fatal
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 21/41
2024/11/27 下午6:59 Python Coding Standard
Information
I1101
Synopsis Used when a variable is accessed for non-existent member of C extension
Level 1
Category Information
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 22/41
2024/11/27 下午6:59 Python Coding Standard
Refactor
R0123
Used when comparing an object to a literal, which is usually what you do not
Synopsis want to do, since you can compare to a different literal than what was expected
altogether
Level 5
Category Refactor
Status Checked
R0202
Synopsis Consider using a decorator instead of calling classmethod
Level 5
Category Refactor
Status Checked
R0203
Synopsis Consider using a decorator instead of calling staticmethod
Level 5
Category Refactor
Status Checked
R0205
Used when a class inherit from object, which under python3 is implicit, hence can
Synopsis
be safely removed from bases
Level 5
Category Refactor
Status Checked
R0401
Synopsis Used when a cyclic import between two or more modules is detected.
Level 4
Category Refactor
Status Checked
R0801
Synopsis Indicates that a set of similar lines has been detected among multiple file
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 23/41
2024/11/27 下午6:59 Python Coding Standard
Level 4
Category Refactor
Status Checked
R0901
Synopsis Used when class has too many parent classes, try to reduce this to get a simpler
Level 4
Category Refactor
Status Checked
R0902
Used when class has too many instance attributes, try to reduce this to get a
Synopsis
simpler
Level 4
Category Refactor
Status Checked
R0904
Synopsis Used when class has too many public methods, try to reduce this to get a simpler
Level 4
Category Refactor
Status Checked
R0911
Used when a function or method has too many return statement, making it hard
Synopsis
to follow
Level 4
Category Refactor
Status Checked
R0912
Used when a function or method has too many branches, making it hard to
Synopsis
follow.
Level 4
Category Refactor
Status Checked
R0913
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 24/41
2024/11/27 下午6:59 Python Coding Standard
R0914
Synopsis Used when a function or method has too many local variables.
Level 4
Category Refactor
Status Checked
R0915
Synopsis Used when a function or method has too many statements
Level 4
Category Refactor
Status Checked
R0916
Synopsis Used when an if statement contains too many boolean expressions.
Level 5
Category Refactor
Status Checked
R1701
Synopsis Used when multiple consecutive isinstance calls can be merged into one.
Level 5
Category Refactor
Status Checked
R1702
Synopsis Used when a function or a method has too many nested blocks
Level 4
Category Refactor
Status Checked
R1703
Synopsis Used when an if statement can be replaced with 'bool(test)'.
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 25/41
2024/11/27 下午6:59 Python Coding Standard
Level 4
Category Refactor
Status Checked
R1704
Used when a local name is redefining an argument, which might suggest a
Synopsis
potential error
Level 2
Category Refactor
Status Checked
R1705
Used in order to highlight an unnecessary block of code following an if containing
Synopsis
a return statement
Level 2
Category Refactor
Status Checked
R1706
Synopsis Used when one of known pre-python 2.5 ternary syntax is used.
Level 4
Category Refactor
Status Checked
R1707
Synopsis Disallow trailing comma tuple
Level 3
Category Refactor
Status Checked
R1708
Synopsis Do not raise StopIteration in generator, use return statement instead
Level 2
Category Refactor
Status Checked
R1709
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 26/41
2024/11/27 下午6:59 Python Coding Standard
R1710
Either all return statements in a function should return an expression, or none of
Synopsis
them should.
Level 3
Category Refactor
Status Checked
R1711
Synopsis Useless return at end of function or method
Level 3
Category Refactor
Status Checked
R1712
Synopsis Consider using tuple unpacking for swapping variables
Level 4
Category Refactor
Status Checked
R1713
Synopsis Consider using str.join(sequence) for concatenating strings from an iterable
Level 4
Category Refactor
Status Checked
R1714
To check if a variable is equal to one of many values, combine the values into a set
Synopsis or tuple and check if the variable is contained "in" it instead of checking for
equality against each of the values
Level 4
Category Refactor
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 27/41
2024/11/27 下午6:59 Python Coding Standard
R1715
Consider using dict.get for getting values from a dict if a key is present or a
Synopsis
default if not
Level 5
Category Refactor
Status Checked
R1716
Synopsis Simplify chained comparison between the operands
Level 4
Category Refactor
Status Checked
R1717
Synopsis Consider using a dictionary comprehension
Level 4
Category Refactor
Status Checked
R1718
Synopsis Consider using a set comprehension
Level 3
Category Refactor
Status Checked
R1719
Synopsis Used when an if expression can be replaced with 'bool
Level 4
Category Refactor
Status Checked
R1720
Used in order to highlight an unnecessary block of code following an if containing
Synopsis
a raise statement
Level 4
Category Refactor
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 28/41
2024/11/27 下午6:59 Python Coding Standard
Warning
W0101
Synopsis Unreachable code
Level 2
Category Warning
Status Checked
W0102
Used when a mutable value as list or dictionary is detected in a default value for
Synopsis
an argument
Level 2
Category Warning
Status Checked
W0104
Synopsis Statement seems to have no effect
Level 2
Category Warning
Status Checked
W0105
Synopsis String statement has no effect
Level 2
Category Warning
Status Checked
W0107
Synopsis Unnecessary pass statement
Level 2
Category Warning
Status Checked
W0108
Synopsis Lambda may not be necessary
Level 2
Category Warning
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 29/41
2024/11/27 下午6:59 Python Coding Standard
Status Checked
W0109
Synopsis Used when a dictionary expression binds the same key multiple times.
Level 5
Category Warning
Status Checked
W0120
Else clause on loop without a break statement, remove the else and de-indent all
Synopsis
the code inside it
Level 5
Category Warning
Status Checked
W0122
Synopsis Use of exec
Level 5
Category Warning
Status Checked
W0123
Synopsis Use of eval
Level 5
Category Warning
Status Checked
W0124
Synopsis Following "as" with another context manager looks like a tuple.
Level 5
Category Warning
Status Checked
W0125
Synopsis Using a conditional statement with a constant value
Level 5
Category Warning
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 30/41
2024/11/27 下午6:59 Python Coding Standard
Status Checked
W0141
Synopsis Used when a disallowed builtin function is used
Level 2
Category Warning
Status Checked
W0150
Synopsis Used when a break or a return statement is found inside the finally clause of a try
Level 2
Category Warning
Status Checked
W0199
Synopsis Assert called on a populated tuple. Did you mean 'assert x,y'?
Level 5
Category Warning
Status Checked
W0201
Synopsis Used when an instance attribute is defined outside the __init__ method.
Level 2
Category Warning
Status Checked
W0211
Used when a static method has "self" or a value specified in valid-classmethod-
Synopsis
first-arg option or valid-metaclass-classmethod-first-arg option as first argument
Level 2
Category Warning
Status Checked
W0212
Synopsis Used when a protected member
Level 2
Category Warning
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 31/41
2024/11/27 下午6:59 Python Coding Standard
Status Checked
W0221
Used when a method has a different number of arguments than in the
Synopsis
implemented interface or in an overridden method
Level 5
Category Warning
Status Checked
W0222
Used when a method signature is different than in the implemented interface or
Synopsis
in an overridden method
Level 2
Category Warning
Status Checked
W0223
Synopsis Used when an abstract method
Level 2
Category Warning
Status Checked
W0231
Used when an ancestor class method has an __init__ method which is not called
Synopsis
by a derived class
Level 2
Category Warning
Status Checked
W0233
Used when an __init__ method is called on a class which is not in the direct
Synopsis
ancestors for the analysed class
Level 2
Category Warning
Status Checked
W0301
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 32/41
2024/11/27 下午6:59 Python Coding Standard
W0311
Used when an unexpected number of indentation's tabulations or spaces has
Synopsis
been found
Level 5
Category Warning
Status Checked
W0401
Synopsis Used when `from module import *` is detected.
Level 2
Category Warning
Status Checked
W0404
Synopsis Used when a module is imported more than once.
Level 2
Category Warning
Status Checked
W0406
Synopsis Module import itself
Level 2
Category Warning
Status Checked
W0410
Synopsis __future__ import is not the first non docstring statement
Level 2
Category Warning
Status Checked
W0511
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 33/41
2024/11/27 下午6:59 Python Coding Standard
W0601
Used when a variable is defined through the "global" statement but the variable is
Synopsis
not defined in the module scope
Level 2
Category Warning
Status Checked
W0602
When a variable defined in the global scope is modified in an inner scope, the
Synopsis 'global' keyword is required in the inner scope only if there is an assignment
operation done in the inner scope
Level 2
Category Warning
Status Checked
W0604
Synopsis Using the global statement at the module level
Level 2
Category Warning
Status Checked
W0611
Synopsis Used when an imported module or variable is not used.
Level 2
Category Warning
Status Checked
W0612
Synopsis Used when a variable is defined but not used.
Level 2
Category Warning
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 34/41
2024/11/27 下午6:59 Python Coding Standard
W0614
Used when an imported module or variable is not used from a `'from X import *'`
Synopsis
style import
Level 2
Category Warning
Status Checked
W0621
Used when a variable's name hides a name defined in an outer scope or except
Synopsis
handler
Level 5
Category Warning
Status Checked
W0622
Synopsis Used when a variable or function override a built-in.
Level 5
Category Warning
Status Checked
W0631
Synopsis Used when a loop variable
Level 2
Category Warning
Status Checked
W0632
Synopsis Used when there is an unbalanced tuple unpacking in assignment
Level 2
Category Warning
Status Checked
W0640
Synopsis A variable used in a closure is defined in a loop
Level 5
Category Warning
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 35/41
2024/11/27 下午6:59 Python Coding Standard
W0641
Synopsis Used when a variable is defined but might not be used
Level 3
Category Warning
Status Checked
W0642
Synopsis Invalid assignment to self or cls in instance or class method respectively.
Level 2
Category Warning
Status Checked
W0702
Synopsis No exception type(s) specified
Level 2
Category Warning
Status Checked
W0705
Used when an except catches a type that was already caught by a previous
Synopsis
handler
Level 5
Category Warning
Status Checked
W0706
Synopsis The except handler raises immediately
Level 3
Category Warning
Status Checked
W0711
Synopsis Used when the exception to catch is of the form "except A or B:"
Level 5
Category Warning
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 36/41
2024/11/27 下午6:59 Python Coding Standard
W0715
Synopsis Exception arguments suggest string formatting might be intended
Level 3
Category Warning
Status Checked
W0716
Used when an operation is done against an exception, but the operation is not
Synopsis
valid for the exception in question
Level 2
Category Warning
Status Checked
W1113
When defining a keyword argument before variable positional arguments, one
Synopsis can end up in having multiple values passed for the aforementioned parameter in
case the method is called with keyword arguments
Level 2
Category Warning
Status Checked
W1201
Synopsis Used when a logging statement has a call form of "logging
Level 5
Category Warning
Status Checked
W1202
Synopsis Used when a logging statement has a call form of "logging
Level 5
Category Warning
Status Checked
W1203
Synopsis Used when a logging statement has a call form of "logging
Level 3
Category Warning
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 37/41
2024/11/27 下午6:59 Python Coding Standard
Status Checked
W1300
Used when a format string that uses named conversion specifiers is used with a
Synopsis
dictionary whose keys are not all strings
Level 5
Category Warning
Status Checked
W1301
Used when a format string that uses named conversion specifiers is used with a
Synopsis
dictionary that contains keys not required by the format string
Level 5
Category Warning
Status Checked
W1302
Synopsis Invalid format string
Level 5
Category Warning
Status Checked
W1303
Used when a PEP 3101 format string that uses named fields doesn't receive one
Synopsis
or more required keywords
Level 5
Category Warning
Status Checked
W1304
Used when a PEP 3101 format string that uses named fields is used with an
Synopsis
argument that is not required by the format string
Level 5
Category Warning
Status Checked
W1305
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 38/41
2024/11/27 下午6:59 Python Coding Standard
Format string contains both automatic field numbering and manual field
Synopsis
specification
Level 5
Category Warning
Status Checked
W1306
Synopsis Used when a PEP 3101 format string uses an attribute specifier
Level 5
Category Warning
Status Checked
W1307
Synopsis Used when a PEP 3101 format string uses a lookup specifier
Level 5
Category Warning
Status Checked
W1308
Used when we detect that a string formatting is repeating an argument instead of
Synopsis
using named string arguments
Level 3
Category Warning
Status Checked
W1402
Synopsis Used when an escape like u is encountered in a byte string where it has no effect
Level 5
Category Warning
Status Checked
W1501
Synopsis Python supports: r, w, a[, x] modes with b, +, and U
Level 5
Category Warning
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 39/41
2024/11/27 下午6:59 Python Coding Standard
W1502
Synopsis Using datetime.time in a boolean context.
Level 5
Category Warning
Status Checked
W1503
Synopsis The first argument of assertTrue and assertFalse is a condition
Level 5
Category Warning
Status Checked
W1506
Synopsis threading.Thread needs the target function
Level 1
Category Warning
Status Checked
W1507
Synopsis Using copy.copy(os.environ). Use os.environ.copy() instead.
Level 3
Category Warning
Status Checked
W1508
Synopsis Env manipulation functions return None or str values
Level 2
Category Warning
Status Checked
W1509
Synopsis Using preexec_fn keyword which may be unsafe in the presence of threads
Level 1
Category Warning
Status Checked
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 40/41
2024/11/27 下午6:59 Python Coding Standard
Literature
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&setid=iXkhI1uSQIqPdB60RVzDiw 41/41