pandas
pandas copied to clipboard
ENH: return current class name in deprecate_nonkeyword_arguments
class A:
@deprecate_nonkeyword_arguments(version=None, allowed_args=["self"])
def method(self, deprecated_positional=None): ...
class B(A): ...
B().method(1) # will warn about `A.method`
Might be nice to warn about B.method
https://github.com/pandas-dev/pandas/pull/48592#discussion_r974747938
Could probably use something like args[0].__class__.__name__
inside the decorator but that assumes that the decorated object is a method and not a function.