Feedback on Sets, and Partitions
ark at acm.org
Fri Apr 30 19:52:44 CEST 2004
> I could live with only immutable sets, but it is nice
> being able to use:
> instead of:
> newmyset = myset | Set([x])
myset |= Set([x])
Presumably that would work analogously to += for strings.
> Another unintutive feature is that there can be multiple sets with the
> same members. I.e., you can have sets A and B such that "A == B" is true
> and "A is B" is false.
Why is that any more unintuitive than the fact that there can be multiple
integers with the same value?
x = 12345
y = 12344+1
After these two statements, most Python implementations will evaluat "x is
y" as false, but of course 1==y is true.
More information about the Python-list