You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class BaseMessage(dict):
pass
@property
def type(self):
return self["type"]
When using flake8-builtins linting, it complains that Argument type is shadowing a python builtin. However in this instance it is not an argument, but an attribute.
This collides with A003, right now A002 takes precedence over A003.
Somewhat interesting discussion around A003 -> gforcada/flake8-builtins#75 though I would say, leave it up to the user. Personally I don't see much point in A003.
The text was updated successfully, but these errors were encountered:
jonathan-s
changed the title
flake8-builtin: shadowing python builtin bug.
A002: flake8-builtin: shadowing python builtin bug.
Feb 20, 2023
jonathan-s
changed the title
A002: flake8-builtin: shadowing python builtin bug. A002: shadowing python builtin bug.
Feb 20, 2023
I think the issue is that it doesn't really make sense to worry about this problem because it's almost never possible to refer to class attributes in a way that would conflict with a builtin.
An interesting approach might be to allow the definition to go through but to flag any potentially-confusing use.
It's also easy enough to just explicitly exclude A003 (or don't select A in the first place). It might make sense to remove A003 from being automatically enabled by A, though.
Ruff version: 0.0.247
When using flake8-builtins linting, it complains that
Argument
typeis shadowing a python builtin
. However in this instance it is not an argument, but an attribute.This collides with
A003
, right nowA002
takes precedence overA003
.Somewhat interesting discussion around
A003
-> gforcada/flake8-builtins#75 though I would say, leave it up to the user. Personally I don't see much point in A003.The text was updated successfully, but these errors were encountered: