Skip to content

function decorators should use decorator to preserve signatures  #137

Closed

Description

@zzzeek

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)

Activity

  1. zzzeek commented on Dec 3, 2018

    @zzzeek
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions