-
-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bind the wrapped function to the instance to which a CachedMethodCaller
is bound
#15056
Comments
comment:1
Another nice feature would be: Have cached unbound methods, that will then be called with an additional instance. What I mean is this:
I am only afraid that in the case of |
comment:2
This is now ready for review (and is a prerequisite for #12978). The underlying idea: We wrap a function Now, in #12978, I envision to wrap arbitrary objects Outside of sage/misc/cachefunc.pyx, only little had to change. In fact, there have just been a few places in which the string representation of a cached method appears in a test---and the string representation has changed, because it is now |
Author: Simon King |
comment:3
Argh. It doesn't work yet. Something in |
comment:5
Attachment: trac15056_bind_wrapped_method.patch.gz The problem was in the Anyway, needs review again. |
comment:9
needs a git branch |
comment:10
I try to turn it into a git branch. Isn't |
Commit: |
comment:12
I created a git branch manually. Needs review! New commits:
|
comment:13
does not apply, needs rebase |
Currently, a cached method will always be a wrapper of a function. It will bind a
CachedMethodCaller
to an instance. However, thisCachedMethodCaller
will not bind the wrapped function to the instance. But in some cases, we might want to make the function depend on the instance, see #12978, for example.Therefore, I suggest to store the bound version of the wrapped function when binding a
CachedMethodCaller
to an instance. There might be a slight benefit timewise, too:I make #12601 a dependency, since it touches the same file.
Depends on #12601
CC: @nthiery
Component: misc
Author: Simon King
Branch/Commit: u/SimonKing/bind_the_wrapped_function_to_the_instance_to_which_a__cachedmethodcaller__is_bound @
016518b
Issue created by migration from https://trac.sagemath.org/ticket/15056
The text was updated successfully, but these errors were encountered: