#5844: [with patch, needs work] Improvement of
PermutationGroup_generic.has_element() and is_subgroup
--------------------------+-------------------------------------------------
Reporter: SimonKing | Owner: SimonKing
Type: enhancement | Status: new
Priority: minor | Milestone: sage-3.4.2
Component: group_theory | Keywords: PermutationGroup has_element
is_subgroup
--------------------------+-------------------------------------------------
Comment(by SimonKing):
Replying to [comment:3 wdj]:
> I got doc-test failures in these modules:
> ...
Here is the reason:
{{{G.has_element()}}} first turns the input {{{item}}} into a
{{{PermutationGroupElement}}} with parent {{{G}}}, using
{{{check=False}}}. So, from now on, the parent of {{{item}}} is {{{G}}}.
The old version then tests if it is contained in the list of elements. The
new version tests whether {{{item in G}}}. The problem is that {{{item in
G}}} just tries {{{PermutationGroupElement(item,G,check=True)}}} -- if
there is an error then False is returned.
But at that point, the parent of {{{item}}} is {{{G}}}, hence,
{{{PermutationGroupElement(item,G,check=True)}}} does not raise an error,
and True is returned!
Anyway. What was the reason to implement {{{has_element}}}? What is the
purpose of it, in contrast to {{{__contains__}}}?
If both are just tests for containment then {{{has_element}}} should be
removed, respectively should be an alias for {{{__contains__}}}.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5844#comment:5>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---