Skip to content

builtin-argument-shadowing (A002) should not fire when overriding #12412

@tylerlaprade

Description

@tylerlaprade

I have a custom API request factory that inherits from Django Rest Framework's APIRequestFactory. I am overriding the post() and patch() methods with some custom behavior. I need to use the same parameters as the overridden method, including one named format. Since format is a Python built-in, A002 is triggered, but I have no recourse to rename it. For now, I'm excluding "format" in builtin-ignores, but I'd prefer to keep triggering on format in any non-overridden method.

By the way, I'm on Python 3.12 and using @override on all my override methods, so it should be easy to determine if a method is an override that way.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions