Skip to content

Conversation

mantepse
Copy link
Contributor

@mantepse mantepse commented Oct 10, 2025

Fixes #41022

Copy link

github-actions bot commented Oct 10, 2025

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

self._k = k

def cardinality(self) -> Integer:
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should start with "Return the cardinality of this set.", or similar.

Other than this, LGTM.

@user202729
Copy link
Contributor

would be nice if we have a use overridden method's description special flag in the docstring I guess.

on the other hand, sphinx already generate Bases: <base classes>. It could also generate for each method Overrides: <overridden methods>, but it currently doesn't.

TESTS::
sage: P = Permutations([1,2,4],2)
sage: P = Permutations([1,2,4,5], 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for modifying the test? The test suite doesn't detect failure on the old tests, but does detect failure on the new one?

(maybe it's safer to run the test suite on both old and new object, but I don't think it's too bad either)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, the old test is si small that it passes.

vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 12, 2025
sagemathgh-41024: fix cardinality of Permutations_setk
    
Fixes sagemath#41022
    
URL: sagemath#41024
Reported by: Martin Rubey
Reviewer(s): mathzeta
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.

Permutations_setk.cardinality() wrong output

3 participants