Skip to content

fix(python): complete Async.Parallel semantics - #5108

Draft
dbrattli wants to merge 6 commits into
feat/python-async-task-parityfrom
fix/python-async-parallel
Draft

dbrattli wants to merge 6 commits into
feat/python-async-task-parityfrom
fix/python-async-parallel

Conversation

@dbrattli

@dbrattli dbrattli commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Complete Python Async.Parallel behavior for #5098 through a new parallel_with_cancellation runtime entry point. The published Python parallel function keeps its behavior. The optional maxDegreeOfParallelism limits active computations, results retain input order, and the degree is validated when the call is made.

The parallel group links its own cancellation token to the parent. On the first failure, it cancels remaining siblings and waits for them to settle before reporting the original error. Fable enumerables use the runtime iterator adapter so the generated library remains type correct. Tests cover bounded concurrency, order, failure cleanup, invalid degree, and empty input through .NET and generated Python.

Python counterpart to #5098. Depends on #5106 for the updated task and child cancellation behavior; review the diff against that branch.

@dbrattli
dbrattli changed the base branch from main to feat/python-async-task-parity October 16, 2026 20:03
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Python Type Checking Results (Pyright)

Metric Value
Total errors 35
Files with errors 5
Excluded files 4
New errors ❌ Yes

⚠️ New Files with Errors

These files are NOT in the exclude list and must be fixed or added to pyrightconfig.ci.json:

File Errors Status
temp/fable-library-py/fable_library/async_.py 2 ⚠️ NEW
Excluded files with errors (4 files)

These files have known type errors and are excluded from CI. Remove from pyrightconfig.ci.json as errors are fixed.

File Errors Status
temp/tests/Python/test_hash_set.py 18 Excluded
temp/tests/Python/test_applicative.py 11 Excluded
temp/tests/Python/test_nested_and_recursive_pattern.py 2 Excluded
temp/tests/Python/fable_modules/thoth_json_python/encode.py 2 Excluded

@dbrattli
dbrattli marked this pull request as draft October 16, 2026 20:22

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant