Re: Proposal: s1.intersects(s2)

2007-07-05 Thread David Abrahams
on Thu Jul 05 2007, Christoph Zwerschke wrote: > Steven D'Aprano wrote: >> I'm not a professional set theorist, but in 15-odd years of studying and >> teaching maths I've never come across mathematicians using intersect as a >> verb except as informal short-hand. I often say "North Street and So

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Christoph Zwerschke
Steven D'Aprano wrote: > I'm not a professional set theorist, but in 15-odd years of studying and > teaching maths I've never come across mathematicians using intersect as a > verb except as informal short-hand. I often say "North Street and South > Street don't intersect", but "the intersection of

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Christoph Zwerschke
Nis Jørgensen wrote: > The problem is, these functions can be read as "X is [consisting only > of] digit[s]", "X is lower [case]" etc, where the bits in brackets have > been removed for brewity. In the case of "s1 is intersect s2" there is > no way I can see of adding words to get a correct sentenc

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread OKB (not okblacke)
Steven D'Aprano wrote: > Just because I've never come across it doesn't mean it exists, so > I'd be grateful for any reference to a technical definition, or > even references to any mathematician using intersect as a verb in a > vigorous, non-hand-waving way. Here's a link to get you started:

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Steven D'Aprano
On Thu, 05 Jul 2007 01:48:58 +, richyjsm wrote: > On Jul 4, 8:14 pm, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> However, there's a very subtle flaw in the idea. While "the intersection" >> of two sets is well-defined, "these two sets intersect" is (surprisingly!) >> _not_ well-defined. >

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Steven D'Aprano
On Thu, 05 Jul 2007 07:34:28 -0700, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> >>My main feeling is that any such function should be a set method rather >>than a built-in function like len(). The name change was comparatively >>unimportant. > >

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >My main feeling is that any such function should be a set method rather >than a built-in function like len(). The name change was comparatively >unimportant. Look up at the Subject: line. There never was any suggestion

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Nis Jørgensen
Steven D'Aprano skrev: > On Wed, 04 Jul 2007 23:53:15 -0400, David Abrahams wrote: > >> on Wed Jul 04 2007, "Steven D'Aprano" >> wrote: >> >>> On Wed, 04 Jul 2007 14:37:34 +, Marc 'BlackJack' Rintsch wrote: >>> On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: > Here's

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread David Abrahams
on Wed Jul 04 2007, "Steven D'Aprano" wrote: > On Wed, 04 Jul 2007 14:37:34 +, Marc 'BlackJack' Rintsch wrote: > >> On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: >> >>> Here's an implementation of the functionality I propose, as a >>> free-standing function: >>> >>> de

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread richyjsm
On Jul 4, 8:14 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > However, there's a very subtle flaw in the idea. While "the intersection" > of two sets is well-defined, "these two sets intersect" is (surprisingly!) > _not_ well-defined. Poppycock! It's perfectly well defined: two sets intersect

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Erik Max Francis
Steven D'Aprano wrote: > The problem comes if we (perhaps naively) try to say that if a set A is a > subset of set B, set A must intersect with B. (Not all intersecting sets > are subsets, but all subsets are intersecting sets.) Unfortunately that is > not the same as asking if the intersection be

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Steven D'Aprano
On Wed, 04 Jul 2007 14:37:34 +, Marc 'BlackJack' Rintsch wrote: > On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: > >> Here's an implementation of the functionality I propose, as a >> free-standing function: >> >> def intersects(s1,s2): >> if len(s1) < len(s2):

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: > Here's an implementation of the functionality I propose, as a > free-standing function: > > def intersects(s1,s2): > if len(s1) < len(s2): > for x in s1: > if x in s2: return True >

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jul 2007 16:18:58 +0200, Thomas Jollans wrote: > On Wednesday 04 July 2007, David Abrahams wrote: >> Right now, the only convenient thing to do is >> >> if s1 & s2 ... >> >> but that builds a whole new set. IMO that query should be available >> as a method of set itself. >

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Thomas Jollans
On Wednesday 04 July 2007, David Abrahams wrote: > Here's an implementation of the functionality I propose, as a > free-standing function: > > def intersects(s1,s2): > if len(s1) < len(s2): > for x in s1: > if x in s2: return True >

Proposal: s1.intersects(s2)

2007-07-04 Thread David Abrahams
Here's an implementation of the functionality I propose, as a free-standing function: def intersects(s1,s2): if len(s1) < len(s2): for x in s1: if x in s2: return True else: for x in s2: if x i