#5308: [with patch, needs review] Removing __len__ for combinatorial classes
(depend on #5200,#4549)
---------------------------+------------------------------------------------
Reporter: hivert | Owner: hivert
Type: enhancement | Status: assigned
Priority: major | Milestone: sage-combinat
Component: combinatorics | Keywords: __len__, count, combinatorial class
---------------------------+------------------------------------------------
Comment(by nthiery):
When applying the patch on top of 3.4 with the following patches applied:
{{{
zephyr-/opt/sage/devel/sage>hg qapplied
integer_lists_lex-4549-submitted.patch
subsets_subwords-5200-submitted.2.patch
subsets_subwords-5200-review.patch
subwords_fix-5534-submitted.patch
combinatorialclass_iter_len_count_cleanup.patch
}}}
I get a reject in
{{{
zephyr-/opt/sage/devel/sage>cat sage/combinat/subset.py.rej
--- subset.py
+++ subset.py
@@ -522,7 +522,7 @@
[0, 1, 3]
sage: S._multiplicities
[1, 2, 1]
- sage: Subsets([1,2,3,3], multiset=True).count()
+ sage: Subsets([1,2,3,3], multiset=True).cardinality()
12
sage: S == loads(dumps(S))
True
@@ -604,7 +604,7 @@
sage: S = Subsets([1,2,3,3],2, multiset=True)
sage: S._k
2
- sage: S.count()
+ sage: S.cardinality()
4
sage: S.first()
[1, 2]
}}}
Moreover, the following tests get broken:
{{{
sage -t "3.4.rc0/devel/sage-
patches/sage/combinat/sf/ns_macdonald.py"
sage -t "3.4.rc0/devel/sage-patches/sage/combinat/subset.py"
sage -t "3.4.rc0/devel/sage-patches/sage/combinat/words/words.py"
}}}
either by the deprecation warnings, or for words by a change of output:
{{{96889010407L -> 96889010407}}}
Other than this, the patch sounds good to me!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5308#comment:5>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---