Re: [sage-support] Re: libgap, simple membership question

2016-03-30 Thread William Stein
On Wed, Mar 30, 2016 at 9:27 AM, Pierre wrote: > >> It also seems that "SymmetricGoup" has its elements live in a pexpect gap, >> not in libgap. It might be attractive to move that too. > > > I was wondering about that: so many sage objects are really GAP objects >

[sage-support] Re: libgap, simple membership question

2016-03-30 Thread Pierre
> It also seems that "SymmetricGoup" has its elements live in a pexpect gap, > not in libgap. It might be attractive to move that too. > I was wondering about that: so many sage objects are really GAP objects wrapped up, with the old code using the pexpect interface, is the plan to re-write

[sage-support] Re: libgap, simple membership question

2016-03-30 Thread Nils Bruin
On Wednesday, March 30, 2016 at 7:46:29 AM UTC-7, Pierre wrote: > > Come to think of it, I just spotted a little bug in libgap: > > sage: p= Permutation([ (1, 2, 3), (4, 5) ]) > sage: pp= libgap( p ); pp > > [ 2, 3, 1, 5, 4 ] > > Here pp is a list, not a permutation ! GAP should respond

[sage-support] Re: libgap, simple membership question

2016-03-30 Thread Pierre
Come to think of it, I just spotted a little bug in libgap: sage: p= Permutation([ (1, 2, 3), (4, 5) ]) sage: pp= libgap( p ); pp [ 2, 3, 1, 5, 4 ] Here pp is a list, not a permutation ! GAP should respond (1,2,3)(4,5), regardless of Sage's default behaviour of printing permutations as lists.

[sage-support] Re: libgap, simple membership question

2016-03-30 Thread Dima Pasechnik
ideally, one would want to overload __contains__ for libgap objects. https://docs.python.org/2/reference/datamodel.html#object.__contains__ then the syntax 'g in G' would just work. (not sure how easy this is) On Wednesday, March 30, 2016 at 10:39:14 AM UTC+1, Pierre wrote: > > Hi ! > > I've

[sage-support] Re: libgap, simple membership question

2016-03-30 Thread Pierre
awesome! perfect solution :-) thanks ! On Wednesday, March 30, 2016 at 2:22:31 PM UTC+2, Volker Braun wrote: > > The "in" operator is the "\in" function in gap: > > sage: G = libgap.SymmetricGroup(3) > sage: g = libgap.eval("(1,2,3)") > sage: isContainedIn = libgap.function_factory(r'\in') >

[sage-support] Re: libgap, simple membership question

2016-03-30 Thread Volker Braun
The "in" operator is the "\in" function in gap: sage: G = libgap.SymmetricGroup(3) sage: g = libgap.eval("(1,2,3)") sage: isContainedIn = libgap.function_factory(r'\in') sage: isContainedIn(g, G) true On Wednesday, March 30, 2016 at 11:39:14 AM UTC+2, Pierre wrote: > > Hi ! > > I've been