summaryrefslogtreecommitdiff
path: root/pyflakes/checker.py
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2023-01-12 11:26:28 -0500
committerGitHub <noreply@github.com>2023-01-12 11:26:28 -0500
commite9324649874a7124a08c3826d4cf78a4dc3aa32c (patch)
treebaf150fcf88fc0103fb9c740a651fae024c18881 /pyflakes/checker.py
parent33bbb8266420e34a93ea74299177c19fd463acc0 (diff)
downloadpyflakes-e9324649874a7124a08c3826d4cf78a4dc3aa32c.tar.gz
produce an error when a definition shadows an unused assignment (#761)
Diffstat (limited to 'pyflakes/checker.py')
-rw-r--r--pyflakes/checker.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py
index e927715..4d778a8 100644
--- a/pyflakes/checker.py
+++ b/pyflakes/checker.py
@@ -263,6 +263,11 @@ class Definition(Binding):
"""
A binding that defines a function or a class.
"""
+ def redefines(self, other):
+ return (
+ super().redefines(other) or
+ (isinstance(other, Assignment) and self.name == other.name)
+ )
class Builtin(Definition):