Skip to content

Issue #3208 - Use more Pythonic get default value#3218

Merged
karlcow merged 1 commit intowebcompat:masterfrom
rik:patch-1
Feb 27, 2020
Merged

Issue #3208 - Use more Pythonic get default value#3218
karlcow merged 1 commit intowebcompat:masterfrom
rik:patch-1

Conversation

@rik
Copy link
Copy Markdown
Contributor

@rik rik commented Feb 21, 2020

This PR fixes issue #3208

Proposed PR background

The second argument for get on mapping objects is the default value when the key is not found. See https://docs.python.org/3/library/stdtypes.html#dict.get.

The default value we use is a value accepted by strtobool so we can move the conversion on the same line.

@rik rik requested a review from karlcow February 21, 2020 22:57
The second argument for `get` on mapping objects is the default value when the key is not found. See https://docs.python.org/3/library/stdtypes.html#dict.get.

The default value we use is a value accepted by `strtobool` so we can move the conversion on the same line.
Copy link
Copy Markdown
Member

@karlcow karlcow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @rik ❤️

@karlcow karlcow merged commit d58299f into webcompat:master Feb 27, 2020
@rik rik deleted the patch-1 branch February 27, 2020 10:31
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.

3 participants