>>> None == False
False
>>> None == True
False
>>> None == None
True
>>> not None
True
If s.add always returns None, then your condition will always be True. But since s is a collection, just add a value to it. You cannot have duplicate values in a set by definition:
>>> a = set()
>>> a.add(1)
>>> a
{1}
>>> a.add(1)
>>> a
{1}
If you just want to know if there is 1 in the set, then if 1 in s.
source
share