We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a46ae8 commit 8dd70cbCopy full SHA for 8dd70cb
pylint/checkers/typecheck.py
@@ -54,7 +54,9 @@
54
from pylint.utils import get_global_option
55
56
BUILTINS = six.moves.builtins.__name__
57
-STR_FORMAT = "%s.str.format" % BUILTINS
+STR_FORMAT = {"%s.str.format" % BUILTINS}
58
+if six.PY2:
59
+ STR_FORMAT.add("%s.unicode.format" % BUILTINS)
60
61
62
def _unflatten(iterable):
@@ -941,7 +943,7 @@ def visit_call(self, node):
941
943
# by keyword argument, as in `.format(self=self)`.
942
944
# It's perfectly valid to so, so we're just skipping
945
# it if that's the case.
- if not (keyword == 'self' and called.qname() == STR_FORMAT):
946
+ if not (keyword == 'self' and called.qname() in STR_FORMAT):
947
self.add_message('redundant-keyword-arg',
948
node=node, args=(keyword, callable_name))
949
else:
0 commit comments