Skip to content
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

let the category of sets handle the __len__ method of rings #38699

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fchapoton
Copy link
Contributor

@fchapoton fchapoton commented Sep 23, 2024

This removes the __len__ method in ring.pyx and let the category of infinite sets handle this.

The test with RR fails 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 use cardinality.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

Copy link

Documentation preview for this PR (built with commit a24e3be; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Collaborator

@tscrim tscrim left a 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__.

@fchapoton
Copy link
Contributor Author

thanks a lot, Travis, for your continuous help and useful insights !

@tscrim
Copy link
Collaborator

tscrim commented Sep 25, 2024

No problem. Thank you for all your work on improving Sage!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants