Closed glensc closed 2 years ago
Actually, you can't use @deprecated
on a property but a function, like this:
>>> from deprecated.classic import deprecated
>>> class Foo(object):
... @property
... @deprecated(reason="something has changed", version="1.2.8")
... def foo(self):
... return "hi"
...
>>> f = Foo()
>>> f.foo
__main__:1: DeprecationWarning: Call to deprecated function (or staticmethod) foo. (something has changed) -- Deprecated since version 1.2.8.
'hi'
Anyway, if you have an idea to implement that, don't hesitate to do a PR.
Also, deprecating a descriptor is a similar subject…
Yes, swapping @property
and @deprecated
order solved the problem.
For my sake, this issue can be closed.
Expected Behavior
Tell us what should happen.
Actual Behavior
Tell us what happens instead.
Environment