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

Cannot use partial for links_factory_imp #183

Open
ntarocco opened this issue Dec 5, 2017 · 1 comment
Open

Cannot use partial for links_factory_imp #183

ntarocco opened this issue Dec 5, 2017 · 1 comment

Comments

@ntarocco
Copy link
Contributor

ntarocco commented Dec 5, 2017

The commint 1804923 is using the python function getargspec to check if the the links_factory_imp has kwargs.
Unfortunately, that python function is checking if the given function is a real function, and it raises a TypeError otherwise.

If we use partial instead, it breaks.
Example:

project_links_factory = partial(deposit_links_factory, deposit_type='project')
"""Project factory for links generation."""

Workaround:

def project_links_factory(pid):
    """Project factory for links generation."""
    deposit_links_factory(pid, deposit_type='project')

Would it possible to add support for partials?

@nharraud
Copy link
Member

nharraud commented Dec 5, 2017

Note: this should also be tested for python 3 with the signature call

@lnielsen lnielsen added this to the someday milestone Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants