WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Cannot use partial for links_factory_imp #183

@ntarocco

Description

@ntarocco

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions