Call GroupByGenerators/GroupWithGenerators with a collection? #2703
Description
@alex-konovalov had noticed a test failure,
see #1619 (comment).
This failure is a side-effect of the changes from pull request #2522.
The operations GroupByGenerators
and GroupWithGenerators
are documented
for a list of generators.
However, their methods accept a collection as the first argument,
and call AsList
in order to create a list from it if necessary.
With the abovementioned changes, a new function MakeGroupyType
was introduced
that assumes the generators to be a list, and this is where the error happens.
Thus the following works in GAP 4.9 but not in the master branch.
GroupByGenerators( Group( (1,2) ) )
I see several possibilities to fix this problem.
-
Change the method installations for
GroupByGenerators
andGroupWithGenerators
such that only a list & collection or an empty list is accepted as the first argument.
This fits to the documentation,
the problem is that existing code may be broken that uses the undocumented feature. -
Change the method installations for
GroupByGenerators
andGroupWithGenerators
such that a non-list collection given as the first argument gets replaced by a list in the beginning. -
Proceed like in 1. but add new methods requiring a collection as the first argument and then
delegating to the methods for lists;
add comments to these methods that they might become obsolete at some time.
What do others think?
Activity