python/osmo-python-tests[master]: cosmetic: early exit instead of if-cascade

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Mar 2 15:01:31 UTC 2017


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/1920/2/osmopy/obscvty.py
File osmopy/obscvty.py:

Line 73:         if self.socket is None:
> if not self.socket:
a None check is more accurate. 'if not x' also catches x == 0, or if a class instance's boolean operator returns false, which is distinct from None. In this case socket will never be '0' or implement a bool, but None is what we really want to check for.


-- 
To view, visit https://gerrit.osmocom.org/1920
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib7b0e45fa1f5551da2fc81b71dcc227eee533f44
Gerrit-PatchSet: 2
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list