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 type annotations to client.dynamic.Dispatch #447

Open
junkmd opened this issue Jan 3, 2023 · 0 comments
Open

Add type annotations to client.dynamic.Dispatch #447

junkmd opened this issue Jan 3, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@junkmd
Copy link
Collaborator

junkmd commented Jan 3, 2023

Remaining tasks for #443 and #444.

def Dispatch(obj):
"""Wrap an object in a Dispatch instance, exposing methods and properties
via fully dynamic dispatch.
"""
if isinstance(obj, _Dispatch):
return obj
if isinstance(obj, ctypes.POINTER(automation.IDispatch)):
try:
tinfo = obj.GetTypeInfo(0)
except (COMError, WindowsError):
return _Dispatch(obj)
return lazybind.Dispatch(obj, tinfo)
return obj

Before PR, please format the code by black (the maximum number of characters per line is 88, which is the default).

@junkmd junkmd added good first issue Good for newcomers drop_py2 dev based on supporting only Python3, see #392 labels Jan 3, 2023
@junkmd junkmd removed the drop_py2 dev based on supporting only Python3, see #392 label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant