Message352227
Per PEP 8, equality comparisons to None should use the "is" or "is not" keywords. However, if x is a {QVariant}NULL, the equality statement with the "is" keyword returns FALSE whereas the "==" comparison returns TRUE.
Hence where cond = {QVariant}NULL:
if cond is None # Returns False
if cond == None # Returns True
This can cause some unexpected code anomalies (as it did for me) when adjusting code for PEP 8 compliance. |
|
Date |
User |
Action |
Args |
2019-09-12 19:25:44 | John Midgett | set | recipients:
+ John Midgett |
2019-09-12 19:25:44 | John Midgett | set | messageid: <1568316344.45.0.265967787088.issue38146@roundup.psfhosted.org> |
2019-09-12 19:25:44 | John Midgett | link | issue38146 messages |
2019-09-12 19:25:44 | John Midgett | create | |
|