Is there a reason being list.append evaluating to false? Or is it just the C convention of returning 0 when successful that comes into play?
>>> u = []
>>> not u.append(6)
True
Is there a reason being list.append evaluating to false? Or is it just the C convention of returning 0 when successful that comes into play?
>>> u = []
>>> not u.append(6)
True
The list.append function returns None. It just adds the value to the list you are calling the method from.
Here is something that'll make things clearer:
>>> u = []
>>> not u
False
>>> print(u.append(6)) # u.append(6) == None
None
>>> not u.append(6) # not None == True
True