#6937 closed defect (fixed)
[with patch, positive review] Fix cached_function to handle defaults better
Reported by: | boothby | Owned by: | boothby |
---|---|---|---|
Priority: | minor | Milestone: | sage-4.1.2 |
Component: | misc | Keywords: | |
Cc: | craigcitro | Merged in: | Sage 4.1.2.alpha4 |
Authors: | Tom Boothby | Reviewers: | Robert Miller |
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
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!
Attachments (1)
Change History (9)
comment:1 Changed 12 years ago by
- Summary changed from Fixed cached_function to handle defaults better. to Fix cached_function to handle defaults better. [with patch, not ready]
comment:2 Changed 12 years ago by
- Summary changed from Fix cached_function to handle defaults better. [with patch, not ready] to Fix cached_function to handle defaults better. [with patch, needs review]
comment:3 Changed 12 years ago by
- Summary changed from Fix cached_function to handle defaults better. [with patch, needs review] to Fix cached_function to handle defaults better. [with patch, needs work]
comment:4 Changed 12 years ago by
Sorry, my gripe should be that "classmethod" is undocumented.
Changed 12 years ago by
comment:5 Changed 12 years ago by
- Summary changed from Fix cached_function to handle defaults better. [with patch, needs work] to Fix cached_function to handle defaults better. [with patch, needs review]
comment:6 Changed 12 years ago by
- Summary changed from Fix cached_function to handle defaults better. [with patch, needs review] to Fix cached_function to handle defaults better. [with patch, positive review]
Bing!
comment:7 Changed 12 years ago by
- Merged in set to Sage 4.1.2.alpha3
- Milestone set to sage-4.1.2
- Resolution set to fixed
- Reviewers set to Robert Miller
- Status changed from new to closed
- Summary changed from Fix cached_function to handle defaults better. [with patch, positive review] to [with patch, positive review] Fix cached_function to handle defaults better
comment:8 Changed 12 years ago by
- Merged in changed from Sage 4.1.2.alpha3 to Sage 4.1.2.alpha4
There is no 4.1.2.alpha3. Sage 4.1.2.alpha3 was William Stein's release for working on the making the notebook a standalone package.
Note: See
TracTickets for help on using
tickets.
Here's a problem:
Here, self isn't 1. a should be 1.