Non è possibile aggiungere il numero intero 1
a un set esistente. In una shell interattiva, questo è quello che sto facendo:L'aggiunta del numero 1 a un set non ha alcun effetto
>>> st = {'a', True, 'Vanilla'}
>>> st
{'a', True, 'Vanilla'}
>>> st.add(1)
>>> st
{'a', True, 'Vanilla'} # Here's the problem; there's no 1, but anything else works
>>> st.add(2)
>>> st
{'a', True, 'Vanilla', 2}
Questa domanda è stato pubblicato due mesi fa, ma credo che è stato frainteso. Sto usando Python 3.2.3.
Perché si tenta di memorizzare valori di verità, stringhe e numeri in un unico insieme? Che problema stavi cercando di risolvere? –