Releases: pywinrt/python-winsdk
v1.0.0b10
v1.0.0b9
v1.0.0b8
Changed
- Updated CppWinRT to v2.0.230225.1.
- Update PyWinRT to v1.0.0-beta.8.
Migration Guide
Some breaking changes were made in this release for better consistency in the language projection and for performance.
Static properties
Static properties are now projected as class attributes instead of class methods. Any uses of ClassName.get_property_name()
must be replaced with ClassName.property_name
.
Arrays
A new winsdk.system.Array
type was introduced for any APIs that involve arrays. The WinRT type system has 3 types of array parameters, PassArray, FillArray and ReceiveArray (docs). The changes affect each type differently.
For PassArray, you must now use an object that supports the buffer protocol with the appropriate type instead of a list
. Lists in existing code can be converted using new_array = winrt.system.Array(ClassName, old_list)
. However, if you are using a basic type like bytes or integers, it is strongly recommended to pass a python bytes
or array.array
directly instead for better performance.
For FillArray the projection has changed to take the array as an argument instead of the size of the array. The array is now filled in place instead of returning a new array. So if you had code like old_list = instance.method(size)
, it needs to be replaced with new_array = winsdk.system.Array(ClassName, size)
and instance.method(new_array)
. Also, the same advice for basic types like bytes and ints applies here. For example, you can pass a bytearray
instance and it will be filled without needing to convert to/from WinRT types. It is even possible to use numpy arrays for structures of basic types, like points and rectangles.
For ReceiveArray, the return value is now a winsdk.system.Array
instead of a list
. You probably won't need to change any code here unless you were using list methods not also supported by the new array type.
v1.0.0b7
v1.0.0b6
Changed
- Update CppWinRT to 2.0.220608.4.
- Update PyWinRT to v1.0.0-beta.6.
v1.0.0b5
Added
- Added Windows Extension SDK APIs python-winsdk#9.
- Added Windows SDK (10.0.22621) for Windows 11, version 22H2 APIs.
Changed
- Update CppWinRT to 2.0.220607.4.
- Update PyWinRT to v1.0.0-beta.5.
v1.0.0b4
Changed
- Update PyWinRT to v1.0.0-beta.4.
v1.0.0b3
Changed
- Update PyWinRT to v1.0.0-beta.3.
v1.0.0b2
Changed
- Update PyWinRT to v1.0.0-beta.2.