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

function decorators should use decorator to preserve signatures #137

Closed
zzzeek opened this Issue Dec 3, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@zzzeek
Copy link
Member

zzzeek commented Dec 3, 2018

example from #136:


In [1]: from dogpile.cache import make_region

In [2]: region = make_region().configure(
   ...:     'dogpile.cache.memory'
   ...: )

In [3]: import inspect

In [4]: def func(a, b, c=True, *args, **kwargs):
   ...:     return None

In [5]: inspect.getargspec(func)
Out[5]: ArgSpec(args=['a', 'b', 'c'], varargs='args', keywords='kwargs', defaults=(True,))

In [6]: cached_func = region.cache_on_arguments()(func)

In [7]: inspect.getargspec(cached_func)
Out[7]: ArgSpec(args=[], varargs='arg', keywords='kw', defaults=None)
@zzzeek

This comment has been minimized.

Copy link
Member Author

zzzeek commented Dec 3, 2018

didn't have the review hook set up, gerrit review at https://gerrit.sqlalchemy.org/#/c/sqlalchemy/dogpile.cache/+/996/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment