wemake-python-styleguide
wemake-python-styleguide copied to clipboard
False positive for `WPS529`
Code like this
def func(**kwargs):
if 'a' in kwargs:
assert 'a_kwargs' not in kwargs
else:
kwargs['a'] = other(
**kwargs.pop('a_kwargs', {}),
)
raises WPS529
I don't think that it is correct, because we can't replace it with .get.
# Correct:
value = collection.get(key)
if value is not None:
print(value)
# Wrong:
if key in collection:
print(collection[key])
Can I work on this?)
@LordGvozd thank you!