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

Functions taking **kwargs #171

Closed
peterbell10 opened this issue Jun 26, 2019 · 3 comments
Closed

Functions taking **kwargs #171

peterbell10 opened this issue Jun 26, 2019 · 3 comments

Comments

@peterbell10
Copy link
Contributor

uarray does not support funtions taking arbitrary keyword arguments because of this line:

kw = {k: kw[k] for k in kw if k in opts}

This silently drops any unknown keyword arguments.

As far as I can tell, the main motivation for this is to support cases where argument_replacer returns extra keyword arguments as is the case with

def _reduce_argreplacer(args, kwargs, arrays):
def reduce(a, axis=None, dtype=None, out=None, keepdims=False):
return (
(arrays[0],),
dict(axis=axis, dtype=dtype, out=arrays[1], keepdims=keepdims),
)

which (as I found out in #170) is used with functions where dtype is not a valid kwarg.

@peterbell10
Copy link
Contributor Author

Why was this closed?

@hameerabbasi
Copy link
Collaborator

I committed to master with a magic comment that fixed this issue. 😄

@peterbell10
Copy link
Contributor Author

Ah, I see. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants