[Python-Dev] API for binary operations on Sets
Nick Coghlan
ncoghlan at gmail.com
Thu Sep 30 14:38:19 CEST 2010
On Thu, Sep 30, 2010 at 1:50 PM, Raymond Hettinger
<raymond.hettinger at gmail.com> wrote:
> 1a. Liberalize setobject.c binary operator methods, restrict SetABC
> methods, and add named methods (like difference, update, etc) that accept
> any iterable.
> 2. We could liberalize builtin set objects to accept any iterable as an
> "other" argument to a binary set operator. This choice is not entirely
> backwards compatible because it would break code depending on being able run
> __ror__, __rand__, etc after a NotImplemented value is returned. That being
> said, I think it unlikely that such code exists. The real disadvantage is
> that it replicates the problems with list.__add__ and Guido has said before
> that he doesn't want to do that again.
> I was leaning towards #1 or #1a and the guys on IRC thought #2 would be
> better. Now I'm not sure and would like additional input so I can get this
> bug closed for 3.2. Any thoughts on the subject would be appreciated.
> Thanks,
My own inclination would be to go with #1a, *unless* Guido chimes in
to say he's OK with having the set operators accept arbitrary
iterators.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list