mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge remote-tracking branch 'origin/python-qual-subclass-shadow' into python-qual-subclass-shadow
This commit is contained in:
@@ -64,7 +64,7 @@ where
|
||||
if isProperty(shadowed)
|
||||
then
|
||||
// it's not a setter, so it's a read-only property
|
||||
extra = " (read-only property may cause an error if written to in the superclass.)"
|
||||
extra = " (read-only property may cause an error if written to in the superclass)"
|
||||
else extra = ""
|
||||
)
|
||||
select shadowed, "This method is shadowed by $@ in superclass $@." + extra, write,
|
||||
|
||||
@@ -2,7 +2,7 @@ class A:
|
||||
def __init__(self):
|
||||
self._foo = 3
|
||||
|
||||
class B:
|
||||
class B(A):
|
||||
# BAD: _foo is shadowed by attribute A._foo
|
||||
def _foo(self):
|
||||
return 2
|
||||
|
||||
Reference in New Issue
Block a user