>> * New method (proposed by Shane Holloway): s1.isdisjoint(s2).
Mike> +1. Disjointness verification is one of my main uses for set(),
Mike> and though I don't think that the early-out condition would
Mike> trigger often in my code, it would increase readability.
I think the
>> I'd rather see iterator versions of the set operations.
>
> Interesting idea. I'm not sure I see how to make it work.
> If s|t returned an iterator, then how would s|t|u work?
I don't think s.union(t) should return an iterator, if for
no other reason than compatibility. Instead, there might
>> * New method (proposed by Shane Holloway): s1.isdisjoint(s2).
>> Logically equivalent to "not s1.intersection(s2)" but has an
>> early-out if a common member is found.
[MvL]
> I'd rather see iterator versions of the set operations.
Interesting idea. I'm not sure I see how to make it work.
On 19/05/2007 3.34, Raymond Hettinger wrote:
> * Make sets listenable for changes (proposed by Jason Wells):
>
> s = set(mydata)
> def callback(s):
> print 'Set %d now has %d items' % (id(s), len(s))
> s.listeners.append(callback)
> s.add(existing_element) # no call
> * New method (proposed by Shane Holloway): s1.isdisjoint(s2).
> Logically equivalent to "not s1.intersection(s2)" but has an
> early-out if a common member is found. The speed-up is potentially
> large given two big sets that may largely overlap or may not
> intersect at all. There is also a m
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Raymond
> Hettinger
> Sent: Friday, May 18, 2007 8:35 PM
> To: python-dev@python.org
> Subject: [Python-Dev] Py2.6 buildouts to the set API
>
> Here some ideas that
On Fri, May 18, 2007, Raymond Hettinger wrote:
>
> Here some ideas that have been proposed for sets:
>
> * New method (proposed by Shane Holloway): s1.isdisjoint(s2).
> Logically equivalent to "not s1.intersection(s2)" but has an early-out
> if a common member is found. The speed-up is potentiall
On 18-May-07, at 6:34 PM, Raymond Hettinger wrote:
> Here some ideas that have been proposed for sets:
>
> * New method (proposed by Shane Holloway): s1.isdisjoint(s2).
> Logically equivalent to "not s1.intersection(s2)" but has an early-
> out if a common member is found. The speed-up is po
Here some ideas that have been proposed for sets:
* New method (proposed by Shane Holloway): s1.isdisjoint(s2). Logically
equivalent to "not s1.intersection(s2)" but has an early-out if a common member
is found. The speed-up is potentially large given two big sets that may
largely overlap or