Skip to content

Commit 2e4d4dc

Browse files
[pywin32] Type pscon property keys as PyPROPERTYKEY (#16656)
pywin32 converts a `PROPERTYKEY` to and from an `(IID, pid)` tuple ([source](https://github.com/mhammond/pywin32/blob/b312/com/win32comext/propsys/src/propsys.cpp#L38-L46)), and every `PKEY_*` constant in `pscon` is such a tuple ([source](https://github.com/mhammond/pywin32/blob/b312/com/win32comext/propsys/pscon.py#L153)). This makes `PyPROPERTYKEY` an alias for `tuple[PyIID, int]` and uses it for the 567 `PKEY_*` constants (plus `int` for `GUIDSTRING_MAX`/`PKEYSTR_MAX`), so the constants can be passed to `propsys` functions that take a `PyPROPERTYKEY`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a746e49 commit 2e4d4dc

2 files changed

Lines changed: 698 additions & 695 deletions

File tree

‎stubs/pywin32/_win32typing.pyi‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5031,7 +5031,8 @@ class PyIViewObject2:
50315031

50325032
class PyMAPINAMEIDArray: ...
50335033
class PyOLEMENUGROUPWIDTHS: ...
5034-
class PyPROPERTYKEY: ...
5034+
5035+
PyPROPERTYKEY: TypeAlias = tuple[PyIID, int]
50355036

50365037
@final
50375038
class PyPROPVARIANT:

0 commit comments

Comments
 (0)