Skip to content

Commit 6d9fd24

Browse files
committed
python: update comments
1 parent e49f7a5 commit 6d9fd24

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

python/ql/test/experimental/dataflow/variable-capture/global.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Here we test writing to a captured variable via the `nonlocal` keyword (see `out`).
1+
# Here we test writing to a captured global variable via the `global` keyword (see `out`).
22
# We also test reading one captured variable and writing the value to another (see `through`).
33

44
# All functions starting with "test_" should run and execute `print("OK")` exactly once.

python/ql/test/library-tests/ApiGraphs/py3/test_captured_inheritance.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ class Baz(A): pass
1313

1414
def other_func():
1515
print(Foo) #$ use=moduleImport("foo").getMember("A").getASubclass() use=moduleImport("foo").getMember("B").getASubclass()
16-
print(Bar) #$ use=moduleImport("foo").getMember("B").getASubclass() MISSING: use=moduleImport("foo").getMember("A").getASubclass() The MISSING here is documenting correct behaviour
16+
# On the next line, we wish to express that it is not possible for `Bar` to be a subclass of `A`.
17+
# However, we have no "true negative" annotation, so we use the MISSING annotation instead.
18+
# (Normally, "true negative" is not needed as all applicable annotations must be present,
19+
# but for type tracking tests, this would be excessive.)
20+
print(Bar) #$ use=moduleImport("foo").getMember("B").getASubclass() MISSING: use=moduleImport("foo").getMember("A").getASubclass()
1721
print(Baz) #$ use=moduleImport("foo").getMember("B").getASubclass() SPURIOUS: use=moduleImport("foo").getMember("A").getASubclass()
1822

1923
class Baz(B): pass

0 commit comments

Comments
 (0)