Skip to content
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

Allow decorating without argument list #38

Open
ErikBjare opened this issue Oct 11, 2018 · 1 comment
Open

Allow decorating without argument list #38

ErikBjare opened this issue Oct 11, 2018 · 1 comment

Comments

@ErikBjare
Copy link

ErikBjare commented Oct 11, 2018

Minor usability issue, should be easy to fix.

Tried using it today and got a weird error.

Traceback (most recent call last):
  ...
  File "/home/.../lib/python3.7/site-packages/deprecation.py", line 232, in _function_wrapper
    function.__doc__ = "".join(string_list)
AttributeError: 'list' object attribute '__doc__' is read-only

This was easily resolved by changing the decorating line from @deprecated to @deprecated(), but expected behavior for most decorators (ime) is to behave identically if arguments were given or not.

If you're fine with this @briancurtin I'll make a PR.

@ErikBjare ErikBjare changed the title Allow decorating without decorator arguments Allow decorating without argument list Oct 11, 2018
@briancurtin
Copy link
Owner

As long as it doesn't complicate the implementation, if you can make that work I'd be fine with it. I don't suspect that using this with no arguments is a very common case, as the specific versions are necessary for the test failure behavior, and those plus the description are needed for anything useful to come out of the documentation changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants