Skip to content

Commit d0ceeed

Browse files
committed
adding colored permutation doctests
1 parent 18e9e4b commit d0ceeed

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/sage/combinat/colored_permutations.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ class ColoredPermutations(Parent, UniqueRepresentation):
435435
sage: s2*t*s2
436436
[[0, 1, 0], [1, 2, 3]]
437437
438-
We can also create a colored permutation by passing
439-
either a list of tuples consisting of ``(color, element)``::
438+
We can also create a colored permutation by passing either
439+
an iterable consisting of tuples consisting of ``(color, element)``::
440440
441441
sage: x = C([(2,1), (3,3), (3,2)]); x
442442
[[2, 3, 3], [1, 3, 2]]
@@ -445,13 +445,23 @@ class ColoredPermutations(Parent, UniqueRepresentation):
445445
446446
sage: C([[3,3,1], [1,3,2]])
447447
[[3, 3, 1], [1, 3, 2]]
448+
sage: C(([3,3,1], [1,3,2]))
449+
[[3, 3, 1], [1, 3, 2]]
448450
449451
There is also the natural lift from permutations::
450452
451453
sage: P = Permutations(3)
452454
sage: C(P.an_element())
453455
[[0, 0, 0], [3, 1, 2]]
454456
457+
458+
TESTS::
459+
460+
sage: T = ColoredPermutations(3,4); type(T[0])
461+
<class 'sage.combinat.colored_permutations.ColoredPermutations_with_category.element_class'>
462+
sage: C(T[0])
463+
[[0, 0, 0], [1, 2, 3]]
464+
455465
REFERENCES:
456466
457467
- :wikipedia:`Generalized_symmetric_group`

0 commit comments

Comments
 (0)