-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change GroupWithGenerators to accept collections again #3095
Change GroupWithGenerators to accept collections again #3095
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes fix the behavior, fine.
My only suggestion is to omit the AsList
calls
inside the ObjectifyWithAttributes
calls,
since AsList
has been applied already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frst off, this modifies both GroupByGenerators
and GroupWithGenerators
but the commit message mentions only the former one.
Furthermore, I am not convinced that calling AsList
is a good idea. Imagine if someone asks, for example:
GroupByGenerators(SymmetricGroup(20))
Are we seriously expecting AsList(SymmetricGroup(20))
to complete? ;-) By the way, this applies to both PRs, as the same call to AsList
is present in #3091.
The other idea suggested elsewhere was to check if the argument is a domain which knows a list of its generators, and in this case call GroupByGenerators
on that list. At least that would allow to avoid expanding domain to a list of its elements. But again, to be done consistently, this should be done for all *ByGenerators
methods... and perhaps also for *WithGenerators
? Hmm... that would also seem controversial - but if done, then the use like that must be documented. However, I'd prefer to not do do it at all. I do think that a proper solution would be just to make a new CTblLib release. That's the only known manifestation of this problem I have discovered so far.
I don't like the idea that is something doesn't break any library code, that's fine. There are many thousands of GAP users out in the world, all with their own code. If (as in this case) it is reasonable for us not to break existing code, which has worked for many years, then I think we should try to do so -- particularly when the error message is hard to read. There are many places in GAP where you can put objects which can be enumerated instead of an explicit list, and in any of those places |
9a825e4
to
ea06288
Compare
Codecov Report
@@ Coverage Diff @@
## master #3095 +/- ##
==========================================
- Coverage 83.56% 83.33% -0.23%
==========================================
Files 686 686
Lines 336733 336735 +2
==========================================
- Hits 281380 280610 -770
- Misses 55353 56125 +772
|
In GAP <= 4.9, this worked: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) In GAP 4.10, this was broken and instead lead to a "method not found" error. While strictly speaking this was never documented behavior, we restore it to avoid regressions in code that relied on this undocumented behavior. Resolves gap-system#2703
ea06288
to
d42fa06
Compare
@ChrisJefferson there is still an alternative:
I would be happy with one of the following:
Anyone in favour? |
@ThomasBreuer ah, thanks for pointing out the extra @alex-konovalov this only modifies two methods for Of course Put another way: any code that currently is "correct" and "adheres to the documentation" will work unchanged. All this PR does is to restore a behavior of GAP that was present for decades (I just checked, GAP 4.4 supports it). I see zero harm in it. Note that I am not suggesting to document this behavior, either, but I don't see how we benefit from gratuitously breaking code that was working before? |
@fingolfin This will not fix #2703 because that one goes into the break loop because of |
@alex-konovalov while I wouldn't mind that warning, IMHO it should be added in a separate PR. This PR is purely about restoring behaviour that was present in GAP for the past 20+ years. To this end, I strove for a minimal set of changes. Any further changes and optimizations, documentation etc. are IMHO beyond the scope of this. And as I said before: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, thanks for pointing out, of course, one delegates to another.
The new commit message looks correct, so I will approve this now, and agree that we keep this undocumented. I will make a PR with a warning if this PR will pass the testing round.
In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and gap-system#3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected.
In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and gap-system#3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected.
In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and gap-system#3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected.
In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and gap-system#3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected.
In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and gap-system#3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected.
In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and gap-system#3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected.
Backported via ac82a50 |
In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and #3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected.
In GAP <= 4.9, this worked:
In GAP 4.10, this was broken and instead lead to a "method not found" error.
While strictly speaking this was never documented behavior, we restore it
to avoid regressions in code that relied on this undocumented behavior.
Resolves #2703
This is a less intrusive (and thus hopefully less controversial) alternative to PR #3091. Closes #3091