#10132: Differential Geometry via Sage
------------------------------------+---------------------------------------
Reporter: mikarm | Owner: mhampton
Type: enhancement | Status: new
Priority: major | Milestone:
Component: geometry | Keywords: differential geometry,
parametrized surface
Author: Mikhail Malakhaltsev | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------------+---------------------------------------
Comment(by jvkersch):
Replying to [comment:20 jason]:
> Are you sure? In the code (the latest patch), it appears that the
`connection_coefficients` return value is constructed as a new dictionary
each time the function is called.
>
Hi Jason,
I think the problem is that when the method is cached, changing the return
value will change the cached copy, and hence when the method is called
again, this modified copy will be returned, e.g,
{{{
from sage.misc.cachefunc import cached_method
class A:
@cached_method
def get_dict(self):
return {1: 'a', 2: 'b', 3: 'c'}
a = A()
d = a.get_dict()
print d
d[3] = 'something else'
print a.get_dict()
}}}
prints
{{{
{1: 'a', 2: 'b', 3: 'c'}
{1: 'a', 2: 'b', 3: 'something else'}
}}}
instead of two copies of the same.
I don't really get why this would cause the problems in
`_create_pt_ode_system`, but addressing it does seem to solve the
problem...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10132#comment:21>
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.