[sage-support] Re: the set containing the empty set

2009-01-10 Thread William Stein
On Sat, Jan 10, 2009 at 9:22 AM, Jason Grout wrote: > > John H Palmieri wrote: >> sage: timeit('set(S).issubset(set(T))') >> >> gives me very similar times to the first option (all(s in T for s in >> S)). So if I start with Sage sets, I don't seem to gain much by >> converting back to python set

[sage-support] Re: the set containing the empty set

2009-01-10 Thread Jason Grout
John H Palmieri wrote: > sage: timeit('set(S).issubset(set(T))') > > gives me very similar times to the first option (all(s in T for s in > S)). So if I start with Sage sets, I don't seem to gain much by > converting back to python sets for this (not to mention that if S = Set > (ZZ), then set(S

[sage-support] Re: the set containing the empty set

2009-01-10 Thread John H Palmieri
On Jan 10, 7:25 am, Jason Grout wrote: > John H Palmieri wrote: > > > > Here's another question: what is the most efficient way of testing > > whether one Set is a subset of another?  I can do > > >     S in list(T.subsets()) > > > -- and it's a bit frustrating that I can't do S in T.subsets() --

[sage-support] Re: the set containing the empty set

2009-01-10 Thread Jason Grout
John H Palmieri wrote: > > > On Jan 9, 3:40 pm, "William Stein" wrote: >> On Fri, Jan 9, 2009 at 3:38 PM, Mike Hansen wrote: >> >>> On Fri, Jan 9, 2009 at 3:36 PM, John H Palmieri >>> wrote: Is this a bug? sage: Set([]) {} sage: Set(Set([])) {} sage: Set([]) ==

[sage-support] Re: the set containing the empty set

2009-01-10 Thread Robert Bradshaw
On Jan 9, 2009, at 9:21 PM, John H Palmieri wrote: > > On Jan 9, 7:03 pm, "William Stein" wrote: >> On Fri, Jan 9, 2009 at 6:42 PM, John H Palmieri >> wrote: >> >>> Here's another question: what is the most efficient way of testing >>> whether one Set is a subset of another? I can do >> >>>

[sage-support] Re: the set containing the empty set

2009-01-09 Thread John H Palmieri
On Jan 9, 7:03 pm, "William Stein" wrote: > On Fri, Jan 9, 2009 at 6:42 PM, John H Palmieri > wrote: > > > Here's another question: what is the most efficient way of testing > > whether one Set is a subset of another?  I can do > > >    S in list(T.subsets()) > > > -- and it's a bit frustrating

[sage-support] Re: the set containing the empty set

2009-01-09 Thread William Stein
On Fri, Jan 9, 2009 at 6:42 PM, John H Palmieri wrote: > > > > On Jan 9, 3:40 pm, "William Stein" wrote: >> On Fri, Jan 9, 2009 at 3:38 PM, Mike Hansen wrote: >> >> > On Fri, Jan 9, 2009 at 3:36 PM, John H Palmieri >> > wrote: >> >> >> Is this a bug? >> >> >> sage: Set([]) >> >> {} >> >> sage

[sage-support] Re: the set containing the empty set

2009-01-09 Thread John H Palmieri
On Jan 9, 3:40 pm, "William Stein" wrote: > On Fri, Jan 9, 2009 at 3:38 PM, Mike Hansen wrote: > > > On Fri, Jan 9, 2009 at 3:36 PM, John H Palmieri > > wrote: > > >> Is this a bug? > > >> sage: Set([]) > >> {} > >> sage: Set(Set([])) > >> {} > >> sage: Set([]) == Set(Set([])) > >> True > >

[sage-support] Re: the set containing the empty set

2009-01-09 Thread William Stein
On Fri, Jan 9, 2009 at 3:38 PM, Mike Hansen wrote: > > On Fri, Jan 9, 2009 at 3:36 PM, John H Palmieri > wrote: >> >> Is this a bug? >> >> sage: Set([]) >> {} >> sage: Set(Set([])) >> {} >> sage: Set([]) == Set(Set([])) >> True > > This is because Set takes a list (iterable) for all the of the

[sage-support] Re: the set containing the empty set

2009-01-09 Thread Mike Hansen
On Fri, Jan 9, 2009 at 3:36 PM, John H Palmieri wrote: > > Is this a bug? > > sage: Set([]) > {} > sage: Set(Set([])) > {} > sage: Set([]) == Set(Set([])) > True This is because Set takes a list (iterable) for all the of the elements of the set. So, if you want to construct the set containing t