Skip to content

Commit 30921d5

Browse files
authored
Merge pull request #1817 from taus-semmle/python-change-notes-1.22
Approved by felicity-semmle
2 parents a22ada1 + f08d857 commit 30921d5

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

change-notes/1.22/analysis-python.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,29 @@
66
### Points-to
77
Tracking of "unknown" values from modules that are absent from the database has been improved. Particularly when an "unknown" value is used as a decorator, the decorated function is tracked.
88

9+
### Loop unrolling
10+
The extractor now unrolls a single iteration of loops that are known to run at least once. This improves analysis in cases like the following
911

10-
### Impact on existing queries.
12+
```python
13+
if seq:
14+
for x in seq:
15+
y = x
16+
y # y is defined here
17+
```
1118

19+
### Better API for function parameter annotations
20+
Instances of the `Parameter` and `ParameterDefinition` class now have a `getAnnotation` method that returns the corresponding parameter annotation, if one exists.
21+
22+
### Improvements to the Value API
23+
- The Value API has been extended with classes representing functions, classes, tuples, and other types.
24+
25+
- `Value::forInt(int x)` and `Value::forString(string s)` have been added to make it easier to refer to the `Value` entities for common constants.
26+
27+
### Other improvements
28+
29+
- Short flags for regexes (for example, `re.M` for multiline regexes) are now handled correctly.
30+
- Modules with multiple import roots no longer get multiple names.
31+
- A new `NegativeIntegerLiteral` class has been added as a subtype of `ImmutableLiteral`, so that `-1` is treated as an `ImmutableLiteral`. This means that queries looking for the use of constant integers will automatically handle negative numbers.
1232

1333
## New queries
1434

0 commit comments

Comments
 (0)