Open ntarocco opened 6 years ago
The commint https://github.com/inveniosoftware/invenio-records-rest/commit/1804923d94fe7d4982979d900fd4c42d8f600a96 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.
getargspec
links_factory_imp
kwargs
If we use partial instead, it breaks. Example:
partial
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?
Note: this should also be tested for python 3 with the signature call
signature
The commint https://github.com/inveniosoftware/invenio-records-rest/commit/1804923d94fe7d4982979d900fd4c42d8f600a96 is using the python function
getargspec
to check if the thelinks_factory_imp
haskwargs
. 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:Workaround:
Would it possible to add support for partials?