#6937: Fixed cached_function to handle defaults better.
---------------------+------------------------------------------------------
Reporter: boothby | Owner: boothby
Type: defect | Status: new
Priority: minor | Milestone:
Component: misc | Keywords:
Reviewer: | Author: boothby
Merged: |
---------------------+------------------------------------------------------
We expect the following example to take about 10 seconds:
{{{
sage: @cached_function
sage: def foo(x = 5):
... print "computing foo(%s)"%x
... sleep(10)
... return 0
sage: w = walltime()
sage: foo()
computing foo(5)
sage: foo(5)
computing foo(5)
sage: foo(x=5)
computing foo(5)
sage: print "that took %s seconds!"%walltime(w)
that took 29.9967029095 seconds!
}}}
... but that obviously isn't the case. fix it!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6937>
Sage <http://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
-~----------~----~----~----~------~----~------~--~---