Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add static typing for _midlSAFEARRAY #580

Merged
merged 7 commits into from
Jul 7, 2024

Conversation

junkmd
Copy link
Collaborator

@junkmd junkmd commented Jul 7, 2024

Thanks to @geppi’s contribution, I’ve come to understand the behavior of SAFEARRAY and _midlSAFEARRAY.

I realized that _midlSAFEARRAY is a factory function that generates a new class, something that cannot be expressed in Python’s usual static type system.
Therefore, I added the LP_SAFEARRAY special typing symbol into hints.

Of course, it is not possible to express all runtime behaviors in the current stub, but since create and unpack will no longer result in static type errors, it should reduce noise during coding.

junkmd added a commit to junkmd/pywinauto that referenced this pull request Jul 7, 2024
@junkmd junkmd added the typing related to Python static typing system label Jul 7, 2024
@junkmd junkmd merged commit 1d74d75 into enthought:main Jul 7, 2024
49 checks passed
@junkmd junkmd deleted the add_LP_SAFEARRAY_typing branch July 7, 2024 08:19
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typing related to Python static typing system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant