Skip to content

ENH: return current class name in deprecate_nonkeyword_arguments #48650

Open
@twoertwein

Description

@twoertwein
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 #48592 (comment)

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions