Skip to content

Fix Python collection bulk and default helper contracts - #219

Open
leileizhang (lei9444) wants to merge 3 commits into
mainfrom
lei9444-fix-collection-helper-contracts
Open

leileizhang (lei9444) wants to merge 3 commits into
mainfrom
lei9444-fix-collection-helper-contracts

Conversation

@lei9444

@lei9444 leileizhang (lei9444) commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Valid projected collection inputs were accepted by direct writes but rejected by inherited bulk-helper typing, and a missing-key setdefault() returned the original input instead of the stored read projection.

Use the shared checked write-input types for mapping update()/setdefault() and the existing vector extend()/+= helpers across generated classes, interface views, Like protocols and inline annotations. Plan refinements in the existing member namespace so native methods, properties and compatibility aliases keep their names and dispatch. Read back a newly stored default without consuming its source; preserve raw Object outputs, unused defaults, get()/pop() fallbacks, JSON null preflight and ordinary partial updates.

Regression coverage exercises real custom WinMD/native member collisions, installed strict consumers, identity and ownership, invalid/released/thread-bound inputs, both generation modes and same-version incremental output. No comparison, boxing-policy, native ABI, collection-base or release changes.

Reuse checked write-input types for mapping update/setdefault and existing vector bulk helpers across class, interface, Like and inline output surfaces. Return the stored read projection after a missing-key default insertion without consuming the caller's source or changing fallback defaults, raw Object reads, JSON null preflight or ordinary partial-update behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c1f7c114-f863-4ba4-824e-3a7423613fa2
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Mixed-language test coverage

Workflow status: ✅ Passed

Layer Lines Functions Branches/regions
Rust, including native .pyd/.node 87.13% 82.68% 86.86% regions
Python aggregate 70.58% n/a 36.93% branches
Python runtime 98.17% n/a 94.57% branches
Generated Python WinRT projections 68.88% n/a 30.47% branches
Generated Python WinRT implementations 72% n/a 46.3% branches
JavaScript aggregate 18.5% 24.91% 56.05% branches
JavaScript runtime 44.27% 45.76% 78.99% branches
Generated WinRT projections 17.36% 19.38% 52.59% branches
Generated WinRT implementations 45.99% 59.19% 60.97% branches
Generated Classic COM projections 11.52% 23.97% 53.4% branches

View workflow run and download full HTML/LCOV/XML reports

leileizhang (lei9444) and others added 2 commits October 9, 2026 23:56
Preserve existing non-collection snapshots by importing helper protocols and annotations only in modules that emit bulk helpers. Reuse the established source/installed dual-mode typing harness so metadata-only coverage can check generated inline declarations before building a native runtime, while installed-mode checks remain source-mask-free.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c1f7c114-f863-4ba4-824e-3a7423613fa2
Plan helper refinements in the existing shared Python member namespace. Native instance/static methods, properties and compatibility aliases keep their established names, signatures and dispatch; a native extend also retains inherited += behavior. Reuse the plan across runtime, stub, Like and interface surfaces and cover real WinMD/native callbacks in both output modes and the hosted native Python lane.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c1f7c114-f863-4ba4-824e-3a7423613fa2
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