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
Weakref not working properly #45758
Comments
The following code is not working as expected: class cls2: c1 = cls1() It prints out: Why is the weakref pointing to a dead object, when it's still alive? |
Because self.bla is a bound-method object, which is created and then >>> class X:
... def foo (self): pass
...
>>> x = X ()
>>> x.foo is x.foo
False Note how the objects are different. |
Closing as invalid. |
It's easier to see what is going on if you print the object ids. The |
Well, too bad. |
I think this methodref function is simpler and much less intrusive |
Yeah, cool :) |
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: