On 09/29/2010 08:50 PM, Raymond Hettinger wrote:
1. Liberalize setobject.c binary operator methods to accept anything
registered to the Set ABC and add a backwards incompatible restriction
to the Set ABC binary operator methods to only accept Set ABC
instances (they currently accept any
On Sep 29, 2010, at 11:11 PM, geremy condra wrote:
P.S. I also encountered a small difficulty in implementing #2 that would
still need to be resolved if that option is chosen.
What's the issue, if you don't mind me asking?
IIRC, just commenting-out the Py_AnySet checks in set_or, set_xor,
On Wed, Sep 29, 2010 at 11:29 PM, Terry Reedy tjre...@udel.edu wrote:
Does this violate the Sequence ABC (assuming there is one)?
There is a Sequence ABC, but it does not define __add__. It only defines
the following methods:
__contains__, __getitem__, __iter__, __len__, __reversed__, count,
On Thu, Sep 30, 2010 at 1:50 PM, Raymond Hettinger
raymond.hettin...@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
I would like to solicit this group's thoughts on how to reconcile the Set
abstract base class with the API for built-in set objects (see
http://bugs.python.org/issue8743 ). I've been thinking about this issue for a
good while and the RightThingToDo(tm) isn't clear.
Here's the situation:
On Wed, Sep 29, 2010 at 8:50 PM, Raymond Hettinger
raymond.hettin...@gmail.com wrote:
I would like to solicit this group's thoughts on how to reconcile the Set
abstract base class with the API for built-in set objects
(see http://bugs.python.org/issue8743 ). I've been thinking about this
On 9/29/2010 11:50 PM, Raymond Hettinger wrote:
I would like to solicit this group's thoughts on how to reconcile the
Set abstract base class with the API for built-in set objects (see
http://bugs.python.org/issue8743 ). I've been thinking about this issue
for a good while and the
On Sep 29, 2010, at 11:29 PM, Terry Reedy wrote:
I do not understand this. List.__add__ is currently *more* restrictive than
set ops in that it will not even accept a 'frozenlist' (aka tuple).
Sorry, that should have been __iadd__().
s = range(5)
s += 'abc'
s
[0, 1, 2, 3, 4, 'a', 'b',
I will say something snarky now and (hopefully) something useful tomorrow.
When ABCs went in I was +0 because, like annotations, I was told I
wouldn't have to care about them. That said; I do actually care about
the set interface and what set-y-ness means for regular duck typing
reasons. What