deprecation icon indicating copy to clipboard operation
deprecation copied to clipboard

Allow decorating without argument list

Open ErikBjare opened this issue 5 years ago • 1 comments

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 avatar Oct 11 '18 15:10 ErikBjare

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.

briancurtin avatar Oct 15 '18 18:10 briancurtin