[Python-ideas] set.add() return value

Terry Reedy tjreedy at udel.edu
Tue Feb 17 16:27:07 CET 2009


Marcin 'Qrczak' Kowalczyk wrote:
> What about:
> 
>    old_len = len(s)
>    s.add(elem)
>    if len(s) != old_len:
>       ...

Nice!




More information about the Python-ideas mailing list