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

convert to more Pythonic access of dicts #17

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

tedder
Copy link
Contributor

@tedder tedder commented Oct 21, 2021

Improving readability, fewer lines. Also used the py3.8 walrus since this action is on 3.8 anyhow.

Technically this changes logic, but it should be an improvement. I mean, "if FOO in dict" will be true even if the value of the entry is None or is ''. So this switches to a stringy truthiness.

Improving readability, fewer lines. Also used the [py3.8 walrus](https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions) since this action is on 3.8 anyhow.

Technically this changes logic, but it should be an improvement. I mean, "if FOO in dict" will be true even if the value of the entry is None or is ''. So this switches to a stringy truthiness.
@tedder tedder requested a review from kneemaa as a code owner October 21, 2021 22:42
Copy link
Owner

@kneemaa kneemaa left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for the cleanup!

@kneemaa kneemaa merged commit 2bfa6f2 into kneemaa:master Oct 29, 2021
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