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

Redundant keyword arguments passing in client.dynamic #428

Closed
junkmd opened this issue Dec 30, 2022 · 1 comment · Fixed by #432
Closed

Redundant keyword arguments passing in client.dynamic #428

junkmd opened this issue Dec 30, 2022 · 1 comment · Fixed by #432
Assignees
Labels
drop_py2 dev based on supporting only Python3, see #392 good first issue Good for newcomers

Comments

@junkmd
Copy link
Collaborator

junkmd commented Dec 30, 2022

THIS IS FOR drop_py2 PLAN! Please see #392.

The following code instantiates a dictionary from the dict class, unpacks it, and passes it to the method as keyworded arguments.

def __getitem__(self, *args):
return self._obj._comobj.Invoke(
self._id, *args, **dict(_invkind=comtypes.automation.DISPATCH_PROPERTYGET)
)
def __setitem__(self, *args):
if _is_object(args[-1]):
self._obj._comobj.Invoke(
self._id,
*args,
**dict(_invkind=comtypes.automation.DISPATCH_PROPERTYPUTREF)
)
else:
self._obj._comobj.Invoke(
self._id,
*args,
**dict(_invkind=comtypes.automation.DISPATCH_PROPERTYPUT)
)

Modernizing this code would allow it to fit on fewer lines.

@junkmd junkmd added good first issue Good for newcomers drop_py2 dev based on supporting only Python3, see #392 labels Dec 30, 2022
@junkmd junkmd self-assigned this Dec 30, 2022
@junkmd
Copy link
Collaborator Author

junkmd commented Dec 30, 2022

I created this issue to serve as a "model case" for future good first issue that I will submit.

I will work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drop_py2 dev based on supporting only Python3, see #392 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant