Skip to content

sage.combinat.permutation.from_cycles produces wrong result when 'cycles' is a generator #34662

@maxale

Description

@maxale

We have

sage: cycles = [[1,2,3],[4,5,6]]
sage: sage.combinat.permutation.from_cycles(6,cycles)
[2, 3, 1, 5, 6, 4]
sage: sage.combinat.permutation.from_cycles(6,(c for c in cycles))
[1, 2, 3, 4, 5, 6]

where the former result is correct and the latter is wrong.

Component: combinatorics

Author: Dave Morris

Branch/Commit: af2f762

Reviewer: Travis Scrimshaw

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions