This package provides Python projections for the Windows Runtime (WinRT) APIs specifically within the `Windows.Foundation.Collections` namespace. It enables Python developers to interact with WinRT collection types like maps, vectors, and property sets. The current version is 3.2.1, with releases occurring frequently, often tied to Windows SDK updates and bug fixes.
pip install winrt-windows-foundation-collectionsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates creating and interacting with a `PropertySet`, a common mutable WinRT map-like collection. It shows how to insert items, retrieve them, and iterate over the collection using both WinRT-specific methods and Python's dictionary-like interface.
Consult the official migration guide for `pywinrt` version 2 to 3 (often found in the project's GitHub repository under `scripts/2to3/README.md`) to adapt your code.
Do not target version `2.0.0`. Use `2.0.1` or later, as `2.0.1` contains fixes and was successfully published.
Upgrade to `winrt-windows-foundation-collections` version 3.1.0 or newer to ensure correct iteration behavior for WinRT collections.
Review `asyncio` task cancellation logic when awaiting WinRT async operations. If previous cancellation behavior was implicitly relied upon, you might need to adjust task handling or error recovery.