What is the differences between using if object is None
versus if not object
?
So while I was doing some coding where I messed up the signals in the QListWidget, where in a selection instance, it is returning me 2 signals, where it returns 2 objects - QListWidgetItem and None.
To address to the None return, I used if object is None
, but I was told that if not object
would be better. Even so, it seems that using either of the 2 if
would still allow me to achieve the same result.
Is there a better case scenario as to when to use either?