#7916: change conjugate(X) to try X.conjugate() [[this is easy!!]]
---------------------------+------------------------------------------------
Reporter: was | Owner: burcin
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-4.3.1
Component: calculus | Keywords:
Work_issues: needs work? | Author: Burcin Erocal
Upstream: N/A | Reviewer:
Merged: |
---------------------------+------------------------------------------------
Changes (by mvngu):
* cc: rossk (added)
* work_issues: => needs work?
Comment:
Does
[http://trac.sagemath.org/sage_trac/attachment/ticket/7916/trac_7916-same_name_method.patch
trac_7916-same_name_method.patch] depend on anything? I got one hunk
failure when applying
[http://trac.sagemath.org/sage_trac/attachment/ticket/7916/trac_7916-same_name_method.patch
trac_7916-same_name_method.patch] on top of Sage 4.3.1.rc0:
{{{
[mv...@mod sage-main]$ pwd
/dev/shm/mvngu/sage-4.3.1.rc0-7916/devel/sage-main
[mv...@mod sage-main]$ hg qimport http://trac.sagemath.org/sage_trac/raw-
attachment/ticket/7916/trac_7916-same_name_method.patch
adding trac_7916-same_name_method.patch to series file
[mv...@mod sage-main]$ hg qpush
applying trac_7916-same_name_method.patch
patching file sage/symbolic/function.pyx
Hunk #1 FAILED at 550
1 out of 1 hunks FAILED -- saving rejects to file
sage/symbolic/function.pyx.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
errors during apply, please fix and refresh
trac_7916-same_name_method.patch
[mv...@mod sage-main]$ cat sage/symbolic/function.pyx.rej
--- function.pyx
+++ function.pyx
@@ -551,10 +551,30 @@
# we should never end up here
raise ValueError, "cannot read pickle"
- def __call__(self, *args, coerce=True, hold=False):
+ def __call__(self, *args, coerce=True, hold=False,
+ dont_call_method_on_arg=False):
+ """
+ Evaluate this function on the given arguments and return the
result.
+
+ EXAMPLES::
+
+ sage: exp(5)
+ e^5
+ sage: gamma(15)
+ 87178291200
+ """
# we want to convert the result to the original parent if the
input
# is not exact, so we store the parent here
org_parent = parent_c(args[0])
+
+ # if there is only one argument, and the argument has an
attribute
+ # with the same name as this function, try to call it to get the
result
+ # The argument dont_call_method_on_arg is used to prevent
infinite loops
+ # when .exp(), .log(), etc. methods call this symbolic function
on
+ # themselves
+ if len(args) == 1 and not hold and not dont_call_method_on_arg
and \
+ hasattr(args[0], self._name):
+ return getattr(args[0], self._name)()
res = super(GinacFunction, self).__call__(*args, coerce=coerce,
hold=hold)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7916#comment:2>
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.