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

Booleans and ENV vars #3208

Closed
davidbgk opened this issue Feb 12, 2020 · 0 comments
Closed

Booleans and ENV vars #3208

davidbgk opened this issue Feb 12, 2020 · 0 comments

Comments

@davidbgk
Copy link

This is a follow up on #3185 after reading @karlcow's week notes and a discussion on IRC about that.

Me recommendation was to try to cast the env vars to booleans as soon as possible (there are a couple of ways to achieve that) and not compare the result here and there against 'ON' or 'OFF', especially in templates but that's another topic.

/cc @rik

karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 21, 2020
karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 21, 2020
karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 21, 2020
rik added a commit to rik/webcompat.com that referenced this issue Feb 21, 2020
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 added a commit to rik/webcompat.com that referenced this issue Feb 21, 2020
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 added a commit to rik/webcompat.com that referenced this issue Feb 21, 2020
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.
karlcow added a commit that referenced this issue Feb 27, 2020
Issue #3208 - Use more Pythonic get default value
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

No branches or pull requests

1 participant