@@ -30,8 +30,9 @@ def test_incompatible_types():
30
30
x .field = str ("Hello" ) # $str=field str SPURIOUS: int=field int
31
31
expects_string (x ) # $ str=field SPURIOUS: int=field
32
32
33
-
33
+ # ------------------------------------------------------------------------------
34
34
# Attributes assigned statically to a class
35
+ # ------------------------------------------------------------------------------
35
36
36
37
class MyClass : # $tracked=field
37
38
field = tracked # $tracked
@@ -40,7 +41,9 @@ class MyClass: # $tracked=field
40
41
instance = MyClass () # $tracked=field
41
42
lookup2 = instance .field # MISSING: tracked
42
43
43
- ## Dynamic attribute access
44
+ # ------------------------------------------------------------------------------
45
+ # Dynamic attribute access
46
+ # ------------------------------------------------------------------------------
44
47
45
48
# Via `getattr`/`setattr`
46
49
@@ -105,6 +108,7 @@ def dunder_dict_indirect_read():
105
108
106
109
# attribute set in method
107
110
# inspired by https://github.com/github/codeql/pull/6023
111
+
108
112
class MyClass2 (object ):
109
113
def __init__ (self ): # $ tracked=foo
110
114
self .foo = tracked # $ tracked=foo tracked
@@ -121,6 +125,7 @@ def possibly_uncalled_method(self):
121
125
122
126
123
127
# attribute set from outside of class
128
+
124
129
class MyClass3 (object ):
125
130
def print_self (self ): # $ tracked=foo
126
131
print (self ) # $ tracked=foo
0 commit comments