We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.get
in
When we see a code like:
if 'inr' in currency_map: indian_currency_name = currency_map['inr'] else: indian_currency_name = 'undefined'
We should raise a refactoring violation. That's how it should be:
currency_map = {'usd': 'US Dollar'} indian_currency_name = currency_map.get('inr', 'undefined')
The second version is more pythonic.
Origin: https://deepsource.io/blog/8-new-python-antipatterns
The text was updated successfully, but these errors were encountered:
https://github.com/PyCQA/pylint/blob/master/pylint/checkers/refactoring.py#L224
Sorry, something went wrong.
5fde5b8
sobolevn
No branches or pull requests
Rule request
Thesis
When we see a code like:
We should raise a refactoring violation. That's how it should be:
The second version is more pythonic.
Origin: https://deepsource.io/blog/8-new-python-antipatterns
The text was updated successfully, but these errors were encountered: