Files
codeql/python/ql/test/query-tests/Classes/overwriting-attribute/overwriting_attribute.py
2026-06-15 16:15:17 +01:00

24 lines
471 B
Python

#Attribute set in both superclass and subclass
class C(object):
def __init__(self):
self.var = 0 # $ Alert
class D(C):
def __init__(self):
self.var = 1 # self.var will be overwritten
C.__init__(self)
#Attribute set in both superclass and subclass
class E(object):
def __init__(self):
self.var = 0 # self.var will be overwritten
class F(E):
def __init__(self):
E.__init__(self)
self.var = 1 # $ Alert