-
Notifications
You must be signed in to change notification settings - Fork 13.3k
some Python nits and fixes #33141
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
some Python nits and fixes #33141
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
continue | ||
a, b = line.split(": ", 1) | ||
data[a] = b | ||
return data | ||
return data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, you can do this with a single comprehension:
with open(nightlies, 'r') as nightlies:
return dict(
line.split(": ", 1)
for line in nightlies
if line.strip() and not line.startswith('#')
)
However, this is obviously a matter of style (and your way is probably more readable to someone who doesn't do a lot of functional programming).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting approach. Looks elegant.
@bors r+ |
📌 Commit a422b7e has been approved by |
No description provided.