|
3 | 3 |
|
4 | 4 | ## General improvements
|
5 | 5 |
|
| 6 | +### Python 3.8 support |
6 | 7 |
|
| 8 | +Python 3.8 syntax is now supported. In particular, the following constructs are parsed correctly: |
| 9 | + |
| 10 | +- Assignment expressions using the "walrus" operator, such as `while chunk := file.read(1024): ...`. |
| 11 | +- The positional argument separator `/`, such as in `def foo(a, /, b, *, c): ...`. |
| 12 | +- Self-documenting expressions in f-strings, such as `f"{var=}"`. |
| 13 | + |
| 14 | +### General query improvements |
| 15 | + |
| 16 | +In an effort to deprecate the `Object` API (e.g. `ClassObject`) in favour of the |
| 17 | +`Value` API (e.g. `ClassValue`), many of the standard queries have been updated |
| 18 | +to use the `Value` API. This should result in more precise results. |
7 | 19 |
|
8 | 20 | ## New queries
|
9 | 21 |
|
|
20 | 32 | |----------------------------|------------------------|------------|
|
21 | 33 | | Unreachable code | Fewer false positives | Analysis now accounts for uses of `contextlib.suppress` to suppress exceptions. |
|
22 | 34 | | `__iter__` method returns a non-iterator | Better alert message | Alert now highlights which class is expected to be an iterator. |
|
23 |
| - |
| 35 | +| Explicit return in __init__ method | Fewer false positives | Instances where the `__init__` method returns the value of a call to a procedure are no longer flagged. | |
| 36 | +| Non-iterable used in for loop | Fewer false positives | `__aiter__` is now recognized as an iterator method. | |
| 37 | +| Unused import | Fewer false positives | Instances where a module is used in a forward-referenced type annotation, or only during type checking are no longer flagged. | |
| 38 | +| Module-level cyclic import | Fewer false positives | Instances where one of the links in an import cycle is never actually executed are no longer flagged. | |
| 39 | +| Undefined export | Fewer false positives | Instances where an exported value may be defined in a module that lacks points-to information are no longer flagged. | |
| 40 | +| Unreachable code | Fewer false positives | Unreachable `else` branches that do nothing but `assert` their non-reachability are no longer flagged. | |
24 | 41 |
|
25 | 42 | ## Changes to QL libraries
|
26 | 43 |
|
27 | 44 | * Django library now recognizes positional arguments from a `django.conf.urls.url` regex (Django version 1.x)
|
| 45 | +* Instances of the `Value` class now support the `isAbsent` method, indicating |
| 46 | + whether the `Value` in question is missing points-to information, but has been |
| 47 | + inferred to likely exist anyway. For instance, if a file contains `import |
| 48 | + django`, but `django` was not extracted properly, there will be a |
| 49 | + `ModuleValue` corresponding to this "unknown" module, and the `isAbsent` |
| 50 | + method will hold for this `ModuleValue`. |
| 51 | +* The `Expr` class now has a nullary method `pointsTo` that returns the possible |
| 52 | + instances of `Value` that this expression may have. |
0 commit comments