Skip to content
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

Expand use of dict get method to simplify code #327

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

equaeghe
Copy link

In the code, there was often both a check for whether a certain key was in a dict and a conditional access of the corresponding value. This can be elegantly combined in a single call to the dict get method, whose default value if the key is not in the dict is None.
Using the get method instead of the check and conditional access makes it possible to simplify the code in various places.
This is done so in this patch.

In the code, there was often both a check for whether a certain key was in a dict and a conditional access of the corresponding value. This can be elegantly combined in a single call to the dict get method, whose default value if the key is not in the dict is None.
Using the get method instead of the check and conditional access makes it possible to simplify the code in various places.
This is done so in this patch.
@coveralls
Copy link

coveralls commented Jun 15, 2020

Coverage Status

Coverage decreased (-0.01%) to 97.868% when pulling bafb96e on equaeghe:equaeghe-patch-1 into 24aac86 on Alir3z4:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants