[issue8743] set() operators don't work with collections.Set instances

Raymond Hettinger report at bugs.python.org
Thu Sep 2 11:04:23 CEST 2010


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

Rough cut at a first patch is attached.

Still thinking about whether Set operations should be accepting any iterable or whether they should be tightened to expect other Set instances.  The API for set() came from set.py which was broadly discussed and widely exercised.  Guido was insistent that non-sets be excluded from the operator interactions (list.__iadd__ being on his list of regrets).   That was probably a good decision, but the Set API violated this norm and it did not include named methods like difference(), update(), and intersection() to handle the iterable cases.

Also, still thinking about whether the comparison operators should be making tight or loose checks.

----------
keywords: +patch
Added file: http://bugs.python.org/file18708/prelim.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8743>
_______________________________________


More information about the Python-bugs-list mailing list