Invalid %s name "%s" Invalid constant name "newline" Invalid variable name "MyVar" Invalid class name "myClass" ...
Used when a name doesn't doesn't fit the naming convention associated to its type (constant, variable, class…).
This message belongs to the basic checker.
PyLint raises this message when an object has a name that doesn't fit the naming convention associated to its object type.
The naming convention is defined with a regular expression, and the naming convention is satisfied if the name matches the regular expression. The regular expression syntax is the normal Python regular expression syntax, as used in Python raw strings (e.g. r"abc").
Options can be used to override the default regular expression associated to each type. The table below lists the types, their associated options, and their default regular expressions.
|Type||Option||Default regular expression|
In addition, the following options are related to naming conventions:
- The good-names option defines names that are always accepted, even if the regular expression associated to its type does not match.
- The bad-names option defines names that are always rejected (see C0102), even if the regular expression associated to its type matches.
Options that are not really related to naming conventions, but to names:
- The bad-functions option defines the names of built-in functions that should not be used (see W0141).