-
-
Notifications
You must be signed in to change notification settings - Fork 722
let the category of sets handle the __len__ method of rings #38699
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
base: develop
Are you sure you want to change the base?
Conversation
|
Documentation preview for this PR (built with commit 23653fb; changes) is ready! 🎉 |
tscrim
left a comment
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.
The issue with RR is that it is an extension class and __len__ is a special slot method in Cython. You can also see this failure with ZZ. So the thing to do is to change the __len__ implementation to be in parallel to Parent.__pow__.
|
thanks a lot, Travis, for your continuous help and useful insights ! |
|
No problem. Thank you for all your work on improving Sage! |
|
You still have the issue with |
|
I agree that |
|
Should I use "NotImplementedError: infinite set" or "ValueError: infinite set" ? |
|
I would say it would depend on if we expect the infinite set version to (eventually) work/be-implemented or not. Granted, we aren't consistent about this either... I would lean to ValueError as a general rule. |
|
So should I change the existing "NotImplementedError" ? |
|
If you want to, go ahead. |
|
Well, I finally would prefer not to do further changes here. |
This removes the
__len__method inring.pyxand let the category of infinite sets handle this.The test with
RRfails in some other bizarre way, so it is marked as a bug.But maybe it would be better to just remove
__len__from rings instead ? People should usecardinality.📝 Checklist