pandas icon indicating copy to clipboard operation
pandas copied to clipboard

ENH: return current class name in deprecate_nonkeyword_arguments

Open twoertwein opened this issue 2 years ago • 0 comments

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.

twoertwein avatar Sep 20 '22 01:09 twoertwein