[issue8743] set() operators don't work with collections.Set instances
Mark Shannon
report at bugs.python.org
Wed Mar 14 17:09:31 CET 2012
Mark Shannon <mark at hotpy.org> added the comment:
Review of set-with-Set.patch:
Looks good overall.
I agree that restricting operations to instances of Set rather than Iterable is correct.
Implementing "__rsub__" in terms of - (subtraction) means that infinite recursion is a possibility. It also creates an unnecessary temporary.
Could you just reverse the expression used in __sub__?
Would you add tests for comparisons; Set() == set(), etc.
There are probably tested implicitly in the rest of the test suite, but explicit tests would be good.
----------
nosy: +Mark.Shannon
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8743>
_______________________________________
More information about the Python-bugs-list
mailing list