Skip to content

make gens and orbits of PermutationGroup immutable #33824

@mantepse

Description

@mantepse

We don't want the following to happen:

sage: G = PermutationGroup([ [(3,4)], [(1,3)] ])
sage: O = G.orbits(); O
[[1, 3, 4], [2]]
sage: O[0] = 1
sage: G.orbits()
[1, [2]]

sage: G = PermutationGroup([[2,1]]); G
Permutation Group with generators [(1,2)]
sage: g = G.gens()
sage: g[0] = 1
sage: G.gens()
[1]

Therefore, we change the return type of gens and orbits to be a tuple of tuples. We keep the _repr_ of PermutationGroup_generic, because the output is more compact.

Note that gens returns a tuple for all other groups I checked.

CC: @tscrim

Component: group theory

Author: Martin Rubey

Branch/Commit: 90005e7

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/33824

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions