Skip to content

Python: Model new built-ins - #22736

Open
tausbn wants to merge 1 commit into
mainfrom
tausbn/python315-model-new-builtins
Open

tausbn wants to merge 1 commit into
mainfrom
tausbn/python315-model-new-builtins

Conversation

@tausbn

@tausbn tausbn commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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).

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`).
@tausbn
tausbn marked this pull request as ready for review October 2, 2026 12:44
@tausbn
tausbn requested a review from a team as a code owner October 2, 2026 12:44
Copilot AI balanced review requested due to automatic review settings October 2, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants