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

Explicitly check for None rather than falsey #1269

Merged
merged 1 commit into from
Oct 19, 2017

Conversation

jeffwidman
Copy link
Collaborator

Be pedantic about checking for identity rather than equality to avoid issues like #1237 / 411bc08

Noticed while reviewing #1266

@jeffwidman jeffwidman requested a review from dpkp October 19, 2017 03:29
@jeffwidman jeffwidman force-pushed the check-for-none-rather-than-false branch from b08b1e4 to 95d33e0 Compare October 19, 2017 03:39
@tvoinarovskyi
Copy link
Collaborator

And it's faster anyway)

@@ -681,8 +681,6 @@ def least_loaded_node(self):
elif 'bootstrap' in self._conns:
return 'bootstrap'

return None
Copy link
Owner

Choose a reason for hiding this comment

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

Slight preference for keeping this as an explicit return. Otherwise we still return None, it is just implicit when the function completes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No problem, reverted.

Be pedantic about checking for identity rather than equality to avoid issues like #1237 / 411bc08
@jeffwidman jeffwidman force-pushed the check-for-none-rather-than-false branch from 95d33e0 to c72182e Compare October 19, 2017 20:25
@jeffwidman jeffwidman merged commit 0bd5d2a into master Oct 19, 2017
@jeffwidman jeffwidman deleted the check-for-none-rather-than-false branch October 19, 2017 20:25
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