Skip to content

Accept string keys in Python XAML ResourceDictionary - #221

Merged
leileizhang (lei9444) merged 4 commits into
mainfrom
lei9444-python-resource-dictionary-keys
Oct 29, 2026
Merged

leileizhang (lei9444) merged 4 commits into
mainfrom
lei9444-python-resource-dictionary-keys

Conversation

@lei9444

Copy link
Copy Markdown
Contributor

Generated WinUI and UWP ResourceDictionary projections now accept str keys directly in native lookup, membership, insertion and removal, with consistent Mapping helpers and .pyi/inline annotations. Keys are boxed as WinRT strings through the existing checked conversion path; lookup remains the native member rather than an overriding helper.

Preserves raw/projected-object keys, raw Object results and key enumeration, defaults, native errors, lifetimes, and member/compatibility-alias precedence. Ordinary Object-keyed IMap/IMapView, other Object APIs, JavaScript, core ABI and release metadata are unchanged.

Regression coverage includes full-identity metadata controls, native-member/helper collisions, strict stub and inline consumers with negative controls, checked native inputs, and real WinUI AccentButtonStyle lookup and key operations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c000b813-441b-407a-bac9-7d03e70279c0
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Mixed-language test coverage

Workflow status: ✅ Passed

Layer Lines Functions Branches/regions
Rust, including native .pyd/.node 87.17% 82.7% 86.9% regions
Python aggregate 70.55% n/a 36.88% branches
Python runtime 98.2% n/a 94.57% branches
Generated Python WinRT projections 68.82% n/a 30.41% branches
Generated Python WinRT implementations 72% n/a 46.3% branches
JavaScript aggregate 18.38% 24.88% 55.96% branches
JavaScript runtime 44.27% 45.76% 78.99% branches
Generated WinRT projections 17.27% 19.36% 52.51% branches
Generated WinRT implementations 45.99% 59.19% 60.97% branches
Generated Classic COM projections 11.38% 23.88% 53.1% branches

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

Normalize ResourceDictionary string subclasses to their underlying str before explicit String boxing. Cover enum keys in generated stubs, inline consumers, native Mapping operations and the WinUI runner without changing generic Object boxing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ba086f9c-a9d8-4e7e-abb3-d0fea864064c
Restore and verify one SDK corpus in Build and coverage instead of reading the runner's rolling installation. Reuse the CI-only pinning fix from PR #225 and preserve exact nullability and dispatcher assertions without changing production generation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ba086f9c-a9d8-4e7e-abb3-d0fea864064c
Retain resolved WinMD ancestor identities and apply the checked ResourceDictionary key contract to derived projections. Emit Mapping default TypeVars at module scope for Pyright inference and runtime annotation resolution. Add independent-default-interface and multilevel inheritance controls, pinned-Pyright inline/stub checks, and unchanged generic Object-map coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ba086f9c-a9d8-4e7e-abb3-d0fea864064c
@lei9444
leileizhang (lei9444) merged commit bd7e3cc into main Oct 29, 2026
28 checks passed
@lei9444
leileizhang (lei9444) deleted the lei9444-python-resource-dictionary-keys branch October 29, 2026 03:00
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.

2 participants