If have some code like this:
class Foo():
def open(self, bar):
# Doing some fancy stuff here, i.e. opening "bar"
pass
When I run flake8
with the flake8-builtins plug-in I get the error
A003 class attribute "open" is shadowing a python builtin
I don't understand how the method could possibly shadow the built-in open
-function, because the method can only be called using an instance (i.e. self.open("")
or someFoo.open("")
). Is there some other way code expecting to call the built-in ends up calling the method? Or is this a false positive of the flake8-builtins
plug-in?
self.open()
andopen()
are different, so there is no issue. – Abdella