-
Notifications
You must be signed in to change notification settings - Fork 109
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
immutables.Map() as default arg should not trigger B008 #133
Comments
To elaborate, would be great if the code below would not give me B008 error: import immutables
from immutables import Map
def this_should_be_fine(mapping = immutables.Map()):
pass
def this_also(mapping = Map()):
pass |
I'm going to pass this one to our core maintainer @ambv since this immutables.Map is from his MagicStack ... I personally don't like us using not stdlib objects, but I'm open to this being an extra install maybe? If we find immytables.Map importable, don't fire the line? |
Yeah I can see how this could be a bit of a bad precedent and a scope creep. Still would love having this one exception, as the stdlib does not include an immutable mapping/dict type, and using immutables types ( def func(mapping = None):
if mapping is None:
mapping = {} Thanks for considering! |
How about making the "immutable function calls" configurable via the ini files. Something like pep8-naming did for classmethod/staticmethod. It's not documented, but I can add exceptions to the config file like
|
I no longer have a need for this now that #144 is merged. |
flake8-bugbear currently allows using the immutable
frozenset()
andtuple()
types as default args of a function.Would it be possible to also whitelist
immutables.Map
from https://github.com/MagicStack/immutables ?The text was updated successfully, but these errors were encountered: