Skip to content

Python: Add models for synchronised iterators - #22733

Open
tausbn wants to merge 1 commit into
mainfrom
tausbn/python315-model-threading-iterators
Open

tausbn wants to merge 1 commit into
mainfrom
tausbn/python315-model-threading-iterators

Conversation

@tausbn

@tausbn tausbn commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

See
https://docs.python.org/3.15/library/threading.html#iterator-synchronization

We handle these as simple Models-as-Data models.

@tausbn
tausbn force-pushed the tausbn/python315-model-threading-iterators branch from 0271a8f to 92a1c91 Compare October 2, 2026 13:29
@tausbn
tausbn marked this pull request as ready for review October 2, 2026 13:39
Copilot AI balanced review requested due to automatic review settings October 2, 2026 13:39
@tausbn
tausbn requested a review from a team as a code owner October 2, 2026 13:39

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 the Python 3.15 APIs and are covered across normal data flow, taint flow, aliases, callbacks, and container types.

Review effort: Balanced
Findings: None

What changed in this PR

Adds Python 3.15 data-flow models for synchronized iterator utilities.

Changes:

  • Models element and taint flow through serialize_iterator and concurrent_tee.
  • Adds normal-flow and taint-tracking coverage.
  • Documents the analysis improvement.
File Description
python/​ql/​lib/​semmle/​python/​frameworks/​Stdlib.model.yml Adds threading iterator models.
python/​ql/​lib/​change-notes/​2026-09-30-python315-threading-iterators.md Records the new modeling.
python/​ql/​test/​library-tests/​dataflow/​threading-iterators/​test.py Exercises normal data flow.
python/​ql/​test/​library-tests/​dataflow/​threading-iterators/​test_taint.py Exercises taint propagation.
python/​ql/​test/​library-tests/​dataflow/​threading-iterators/​options Configures Python 3 extraction.
python/​ql/​test/​library-tests/​dataflow/​threading-iterators/​NormalDataflowTest.ql Provides the normal-flow test harness.
python/​ql/​test/​library-tests/​dataflow/​threading-iterators/​NormalDataflowTest.expected Contains the generated normal-flow baseline.
python/​ql/​test/​library-tests/​dataflow/​threading-iterators/​InlineTaintTest.ql Provides the taint test harness.
python/​ql/​test/​library-tests/​dataflow/​threading-iterators/​InlineTaintTest.expected Contains the generated taint baseline.

💡 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