Skip to content

bad-dunder-method-name (PLW3201) - false positive on __replace__ dunder #14145

@DetachHead

Description

@DetachHead
from copy import replace


class Foo:
    def __replace__(self, *args: object, **kwargs: object): # PLW3201: Dunder method `__replace__` has no special meaning in Python 3
        print("hi")


replace(Foo()) # calls `Foo.__replace__`

playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpython313Related to Python 3.13

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions