@@ -30,8 +30,9 @@ def test_incompatible_types():
3030 x .field = str ("Hello" ) # $str=field str SPURIOUS: int=field int
3131 expects_string (x ) # $ str=field SPURIOUS: int=field
3232
33-
33+ # ------------------------------------------------------------------------------
3434# Attributes assigned statically to a class
35+ # ------------------------------------------------------------------------------
3536
3637class MyClass : # $tracked=field
3738 field = tracked # $tracked
@@ -40,7 +41,9 @@ class MyClass: # $tracked=field
4041instance = MyClass () # $tracked=field
4142lookup2 = instance .field # MISSING: tracked
4243
43- ## Dynamic attribute access
44+ # ------------------------------------------------------------------------------
45+ # Dynamic attribute access
46+ # ------------------------------------------------------------------------------
4447
4548# Via `getattr`/`setattr`
4649
@@ -105,6 +108,7 @@ def dunder_dict_indirect_read():
105108
106109# attribute set in method
107110# inspired by https://github.com/github/codeql/pull/6023
111+
108112class MyClass2 (object ):
109113 def __init__ (self ): # $ tracked=foo
110114 self .foo = tracked # $ tracked=foo tracked
@@ -121,6 +125,7 @@ def possibly_uncalled_method(self):
121125
122126
123127# attribute set from outside of class
128+
124129class MyClass3 (object ):
125130 def print_self (self ): # $ tracked=foo
126131 print (self ) # $ tracked=foo
0 commit comments