#11300: Add get_part method to partition.py
------------------------------+---------------------------------------------
Reporter: jbandlow | Owner: sage-combinat
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-4.7.1
Component: combinatorics | Keywords: partitions, days30
Work_issues: | Upstream: N/A
Reviewer: Florent Hivert | Author: Jason Bandlow
Merged: | Dependencies:
------------------------------+---------------------------------------------
Comment(by saliola):
Hello Jason. I'm curious: did you compare timings of using the try-except
statement:
{{{
768 try:
769 return self[i]
770 except IndexError:
771 return default
}}}
with an if statement, like this one:
{{{
if i < len(self._list):
return self._list[i]
else:
return default
}}}
I would guess that try-except statements are slower, but I have not tried
it.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11300#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
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.