#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 hivert):
Dear Nicolas,
I sumbmitted a new patch which should addres all the issues except this
last one:
> In the examples (like in SemistandardTableaux), do we want to use: {{{[t
for t in iterable]}}} or {{{list(iterable)}}}
I think both kind of example should by advertised. IMHO, they both are
very python idiomatic, the first one allows for extra condition, the
second one is shorter. The only clear argument is that the first one is
slightly faster:
{{{
sage: timeit("it = iter(Permutations(6)); list(it)")
125 loops, best of 3: 4.57 ms per loop
sage: timeit("it = iter(Permutations(6)); list(it)")
125 loops, best of 3: 4.45 ms per loop
sage: timeit("it = iter(Permutations(6)); [i for i in it]")
125 loops, best of 3: 4.64 ms per loop
sage: timeit("it = iter(Permutations(6)); [i for i in it]")
125 loops, best of 3: 4.61 ms per loop
}}}
Do we really what to standardize all the doc on it ?
Cheers,
Florent
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5308#comment:8>
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
-~----------~----~----~----~------~----~------~--~---