winrt-runtime 2.2.0__tar.gz → 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-runtime
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -0,0 +1 @@
1
+ 2.3.0
@@ -1,7 +1,17 @@
1
+ import sys
1
2
  from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence
2
3
  from pathlib import Path
3
4
  from typing import Annotated
4
5
 
6
+ if sys.version_info >= (3, 12):
7
+ from collections.abc import Buffer as _buffer
8
+ else:
9
+ from array import array as _array
10
+ from typing import Union
11
+
12
+ # Before PEP 688, this was the best we could do
13
+ _buffer = Union[bytes, bytearray, memoryview, _array]
14
+
5
15
  from .. import _winrt
6
16
 
7
17
 
@@ -176,6 +186,11 @@ Object = _winrt.Object
176
186
  Array = _winrt.Array
177
187
  _mixin_mutable_sequence(Array)
178
188
 
189
+ # Type hints for Python buffer protocol - can use standard Python types in
190
+ # addition to the WinRT Array.
191
+ ReadableBuffer = _buffer # WinRT PassArray
192
+ WriteableBuffer = _buffer # WinRT FillArray
193
+
179
194
  __all__ = [
180
195
  "Int8",
181
196
  "UInt8",
@@ -190,4 +205,6 @@ __all__ = [
190
205
  "Char16",
191
206
  "Object",
192
207
  "Array",
208
+ "ReadableBuffer",
209
+ "WriteableBuffer",
193
210
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-runtime
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -1 +0,0 @@
1
- 2.2.0
File without changes
File without changes
File without changes
File without changes
File without changes