Conversation
For `sentinel`, we just add it to the list of the known built-ins. For `frozendict`, we additionally add a flow summary (which just replicates the existing summary for `dict`).
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The models match Python 3.15 semantics and are covered by focused positive and negative tests.
Review effort: Balanced
Findings: None
What changed in this PR
Adds Python 3.15 frozendict and sentinel recognition, including frozendict data-flow modeling.
Changes:
- Registers both new built-ins in API graphs.
- Reuses dictionary propagation semantics for
frozendict. - Adds data-flow, taint-tracking, and API graph tests.
| File | Description |
|---|---|
python/ql/test/library-tests/dataflow/tainttracking/defaultAdditionalTaintStep-py3/test_frozendict.py |
Tests taint propagation. |
python/ql/test/library-tests/dataflow/frozendict/test.py |
Covers constructor forms and mapping operations. |
python/ql/test/library-tests/dataflow/frozendict/options |
Configures extraction. |
python/ql/test/library-tests/dataflow/frozendict/NormalDataflowTest.ql |
Defines the data-flow test query. |
python/ql/test/library-tests/dataflow/frozendict/NormalDataflowTest.expected |
Records expected test output. |
python/ql/test/library-tests/ApiGraphs/py3/test.py |
Tests built-in API resolution. |
python/ql/lib/semmle/python/frameworks/Stdlib.qll |
Adds the frozendict flow summary. |
python/ql/lib/semmle/python/dataflow/new/internal/Builtins.qll |
Registers the new built-ins. |
python/ql/lib/change-notes/2026-09-22-python315-builtins.md |
Documents the analysis improvement. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For
sentinel, we just add it to the list of the known built-ins. Forfrozendict, we additionally add a flow summary (which just replicates the existing summary fordict).