ManyToManyField
found PTC-W0905Having a nullable many-to-many field doesn't do anything. The declaration of a ManyToManyField
causes the creation of an intermediate table to hold the relationship. Each relation between the two tables is an entry in this new table. By definition, having no relations between two tables would mean no entries in this table. There's no use of null
. Consider removing null=True
from this property.
In order to conform to the object model, classes that define their own equality method should also define their own hash method, or be unhashable. If the hash method is not defined then the hash of the super class is used. This is unlikely to result in the expected behavior. A class can be made unhashable by setting its __hash__
attribute to None.
NotImplemented
is not allowed FLK-F901While returning NotImplemented
would be fine, raising it doesn't work and will cause a TypeError
because NotImplemented
is not an exception type.
Debuggers should only be used temporarily and locally. It is highly recommended to remove debug statements in checked-in code.
The class is using, as a metaclass, something which might be invalid for using as a metaclass.
except
, specify exception instead FLK-E722Using except
without a specific exception can be error prone.
unicode
built-in detected PYL-W1612The built-in function being accessed has been removed from Python 3. Please consult the documentation.
init
method converted to generator PYL-E0100The __init__()
method is required to return nothing, but a yield
statement in its body was detected. This will raise a TypeError
.
Local variables should be defined before they are referenced.
Loop variables should not redefine the name of modules that are imported.
A unary operand is used on an object which does not support this type of operation. This is an error.
All dictionary keys should be unique.
There are more than one starred expressions (*x) in an assignment. This is a SyntaxError.
The format string was terminated before the end of a conversion specifier. It is recommended to look again and verify if the conversion specifier is given.
A slice is indexed with an invalid type. Valid types are int
s, slices, and objects with an __index__
method.
xrange
built-in detected PYL-W1613The built-in function being accessed has been removed from Python 3. Please consult the documentation.
Deletion is supported only for items which implement __delitem__
.
super()
call PYL-E1003The first argument to the super()
function must be the current class.
admin.py
PTC-W0903Admin classes not in an app's admin.py
can cause circular import problems throughout a project. This is because registering an admin class implies a call to models.get_apps()
which attempts to import every models.py
in the project.
raw_input
built-in detected PYL-W1609The built-in function being accessed has been removed from Python 3. Please consult the documentation.