From 8bcd4059104329b6fcaa6436fc6d6fa458cca23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rogalski?= Date: Sun, 6 Nov 2016 11:34:45 +0100 Subject: Don't emit unused-argument and function-redefined for singledispatch implementations Closes #1032 and #1034 --- pylint/checkers/variables.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pylint/checkers/variables.py') diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 0823864a0..c8b49f7b6 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -692,6 +692,10 @@ class VariablesChecker(BaseChecker): if is_method and node.is_abstract(): return + # Don't check arguments of singledispatch.register function. + if utils.is_registered_in_singledispatch_function(node): + return + global_names = _flattened_scope_names(node.nodes_of_class(astroid.Global)) nonlocal_names = _flattened_scope_names(node.nodes_of_class(astroid.Nonlocal)) -- cgit v1.2.1