Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-03 Thread Travis Scrimshaw
#19562 is probably the best fix, but really that makes FiniteEnumeratedSet not really any different than our (finite) Sequence class. I'm thinking we need some sort of unification long-term. > Also, instead of Subsets(L), I would also use subsets(L) (or powerset(L)) > > as you don't need the

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-03 Thread Johan S . H . Rosenkilde
> Travis wrote: > Also, instead of Subsets(L), I would also use subsets(L) (or powerset(L)) > as you don't need the set of all subsets to be a parent. I see now that those functions don't support an argument for which size subsets you need (which is critical in my application). Best, Johan --

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-03 Thread Johan S . H . Rosenkilde
Hi everyone, OK, we can bicker about the semantic difference of the words "bug" vs "intentional but bad design" all day, but in the end we agree it's not great for the user. It seems the ever-vigilant Vincent discovered the problem already a year ago and proposed a sensible fix for the problem in

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-03 Thread Vincent Delecroix
https://trac.sagemath.org/ticket/19562 -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-02 Thread Travis Scrimshaw
On Wednesday, November 2, 2016 at 7:59:42 PM UTC-5, Luca De Feo wrote: > > > It is not a bug, but a by product of wanted (with documentation) of the > > UniqueRepresentation and the coercion system in Sage. More below. > > This is a bug. > > The fact that it is a consequence of wanted and

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-02 Thread Jori Mäntysalo
On Wed, 2 Nov 2016, Johan S. H. Rosenkilde wrote: for S in Subsets(GF(13).list(), 5): if sum(S) == 1: print "Monkey" This code works as expected and prints monkeys galore when evaluating it in a Sage shell. Now restart Sage and call the following line before calling the above snippet:

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-02 Thread Luca De Feo
> It is not a bug, but a by product of wanted (with documentation) of the > UniqueRepresentation and the coercion system in Sage. More below. This is a bug. The fact that it is a consequence of wanted and documented behaviour just shows that the wanted behaviour was badly designed (regardless of

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-02 Thread Travis Scrimshaw
Hey Johan, > From my point of view, this can only be considered a bug: extremely > surprising behaviour leading to subtle problems in user code (my code). > Possibly, the bug is higher up than FiniteEnumeratedSets, though. > It is not a bug, but a by product of wanted (with documentation) of

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-02 Thread John H Palmieri
On Wednesday, November 2, 2016 at 2:02:18 PM UTC-7, Johan S. H. Rosenkilde wrote: > > Hi Travis, > > From my point of view, this can only be considered a bug: extremely > surprising behaviour leading to subtle problems in user code (my code). > Possibly, the bug is higher up than

Re: [sage-devel] Re: Bug in caching mechanism of FiniteEnumeratedSet

2016-11-02 Thread Johan S . H . Rosenkilde
Hi Travis, >From my point of view, this can only be considered a bug: extremely surprising behaviour leading to subtle problems in user code (my code). Possibly, the bug is higher up than FiniteEnumeratedSets, though. I'll explain: This came about when using Subsets. Basically, I'm doing