Instead of adding a variable to a set correct e.g.:
set_to_add_to = set()
set_to_add_to.add("test")
I just accidentally coded:
set_to_add_to = set()
set_to_add_to = set_to_add_to.add("test")
While i appreciate this is not how you shoudl add items to a set, it supersized me that doing the above resulted in set_to_add_to taking the value None. I couldn't work out why that would happen - it seems analogous to int_variable = int_variable + 5, which works correctly.
Similarly:
set_to_add_to = set()
new_set = set_to_add_to.add("test")
results in new_set taking the value None - why is it not the case that first test is added to set_to_add_to and then that assigned to new_set?