#11298: Extend the capabilities of Sage's introspection
-------------------------+--------------------------------------------------
Reporter: SimonKing | Owner: jason
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7.1
Component: misc | Keywords: edit sageinspect
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies:
-------------------------+--------------------------------------------------
Comment(by SimonKing):
Note that, with the patch, `functools.partial` objects can be reasonably
edited as well:
{{{
edit(sage.combinat.partition_algebra.SetPartitionsAk,'vim')
}}}
opens vim at line 31 of sage/combinat/partition_algebra.py:
{{{
def create_set_partition_function(letter, k):
"""
EXAMPLES::
sage: from sage.combinat.partition_algebra import
create_set_partition_function
sage: create_set_partition_function('A', 3)
Set partitions of {1, ..., 3, -1, ..., -3}
"""
from sage.functions.all import floor
if isinstance(k, (int, Integer)):
if k > 0:
return globals()['SetPartitions' + letter + 'k_k'](k)
elif is_RealNumber(k):
if k - math.floor(k) == 0.5:
return globals()['SetPartitions' + letter +
'khalf_k'](floor(k))
raise ValueError, "k must be an integer or an integer + 1/2"
}}}
and indeed that is the underlying definition of `SetPartitionsAk`; see
line 53, which is
{{{
SetPartitionsAk = functools.partial(create_set_partition_function,"A")
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11298#comment:3>
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.