Sorry, something went wrong.
| @@ -170,10 +170,7 @@ weakref_repr(PyWeakReference *self) | |||
| } | |||
|
|
|||
| Py_INCREF(obj); | |||
There was a problem hiding this comment.
Do we still need it? 🤔
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, without it:
Sorry, something went wrong.
|
You were suggested reviewers :) |
Sorry, something went wrong.
|
Note for reviewers about dynamic __weakref__. One might think that this PR can break existing dynamic __weakref__ assignment. For example: >>> import weakref
>>> class A: ...
...
>>> a = A()
>>> w = weakref.ref(a)
>>> a1 = A()
>>> a1.__weakref__
>>> a1.__weakref__ = w
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: attribute '__weakref__' of 'A' objects is not writable
But, as you can see it is not writable. So, it should not affect anything really. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
GH-103789 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
Consider this as a fix proposal :)
Thanks a lot to @MojoVampire for the idea.