-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The name filter
shadows a builtin
#464
Comments
Hey, thanks for raising that pylint complains about overriding builtins. It's a bit of a funky situation, since pylint also discourages people from using the filter function (see this SO post). I wonder if it's easier to disable the specific pylint warning about overriding builtins (mentioned in that SO post)? WDYT? Alternatively, you could import siuba as sb
from siuba import _, mutate
sb.filter(...) This would be similar to how numpy exposes a import numpy as np
from numpy import mean
np.sum(...) |
I don't really want to disable that warning across the board, since it can be helpful to know whether a built-in is overridden in some cases. I don't think pylint allows you to suppress the warning on a function-by-function basis though. So I'd prefer I do worry that |
filter
filter
shadows a builtin
Pylint has a configuration setting which I think will work for my purposes: [tool.pylint.variables]
redefining-builtins-modules = ["siuba"] Perhaps this would be worth documenting somewhere? |
Since
filter
is a builtin, my linter (pylint) warns me about overriding it with the alternative implementation fromsiuba
. I am currently usingAs a workaround. However, this is a little bit clumsy and I was wondering whether there would be support for a built-in alias for filter (such as
filtr
) which would avoid this issue: so I could do something likeThe text was updated successfully, but these errors were encountered: