Skip to content

cartesian_product AssertionError #14224

@eviatarbach

Description

@eviatarbach

As of now, passing a list, tuple, or set to cartesian_product returns an AssertionError.

sage: cartesian_product([[0,1]])
AssertionError: 
sage: cartesian_product([FiniteEnumeratedSet([0,1])])  
The cartesian product of ({0, 1},)

I understand that this function can construct Cartesian products on different categories, so I see why it requires specific types. However, the error message should be more descriptive, especially considering that cartesian_product_iterator([[0,1]]), CartesianProduct([0,1]), and permutations([[0,1]]) all work.

Component: combinatorics

Reviewer: Frédéric Chapoton, Vincent Delecroix

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions