[pypy-issue] Issue #2689: _thread.lock is not weakrefable (pypy/pypy)

Ronan Lamy issues-reply at bitbucket.org
Sat Oct 28 05:17:53 EDT 2017

New issue 2689: _thread.lock is not weakrefable

Ronan Lamy:

Python 3.5.3 (61c11feab4e6, Oct 09 2017, 15:04:00)
[PyPy 5.10.0-alpha0 with GCC 6.2.0 20160901] on linux
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``A pink glittery rotating lambda''
>>>> import weakref, _thread
>>>> weakref.ref(_thread.allocate_lock())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot create weak reference to '_thread.lock' object

Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import weakref, _thread
>>> weakref.ref(_thread.allocate_lock())
<weakref at 0x7f5870f635e8; dead>

More information about the pypy-issue mailing list