-
Notifications
You must be signed in to change notification settings - Fork 154
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
Use decorator module for signature-preserving decorators #212
Comments
Hi @OOPMan, do you have an example use case, if possible I would prefer to use https://docs.python.org/3/library/functools.html#functools.wraps rather than adding a new dependency :) |
@argaen I believe you can achieve the same with wraps (In fact, I think decorator does use wrap to some extent) but there's more work involved. Honestly, I wouldn't consider this a high priority, it's just something I've run into now and then with certain code trying to implement the concept of interfaces in Python and checking that functions conform to the interface (IIRC, this is a thing in the Zope part of the Python world). When you decorate such a function in a non-signature preserving way the interface nonsense complains because a function which was It's really rather silly :-) |
I'm happy to add the |
@argaen Sure |
It looks like your awesome
cached
andmulti_cached
decorators don't make use of https://pypi.python.org/pypi/decorator which helpers write cleaner decorators that benefit from signature-preservation (which is important to some people :-)I could submit a PR if you like?
The text was updated successfully, but these errors were encountered: