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
_register is not safe #42298
Comments
The _register function is not safe. It uses the following code to f = CallWrapper(func, subst, self).__call__
name = repr(id(f)) It then adds the function name if func has a __name__ attribute, but For example: f = foo()
print id(f)
print id(f.meth1)
print id(f.meth2) Odds are good that the last two printed numbers will be the same I don't know how to best handle this. Possibilities include:
-- Russell |
Logged In: YES Can you provide a test case that demonstrates the problem? I don't think there is anything wrong with that code. We You are also wrong that the name is not added for bound >>> f.meth1.im_func.__name__
'meth1' |
Logged In: YES You are right. I should have realized that cratecommand kept a reference I replicated _register so as to not use a Tkinter internal function, and at |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: