Message386841
| Author |
iritkatriel |
| Recipients |
amaury.forgeotdarc, arigo, ghaering, iritkatriel, jcea, lkraav, pitrou, pxd |
| Date |
2021年02月11日.23:12:45 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1613085165.77.0.320536668071.issue15108@roundup.psfhosted.org> |
| In-reply-to |
| Content |
Still happening in 3.10:
Python 3.10.0a5+ (heads/master:bf2e7e55d7, Feb 11 2021, 23:09:25) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gc
>>> TAG = object()
>>>
>>> def monitor():
... lst = [x for x in gc.get_referrers(TAG)
... if isinstance(x, tuple)]
... t = lst[0] # this *is* the result tuple
... print(t) # full of nulls !
... return t # Keep it alive for some time
...
>>> def my_iter():
... yield TAG # 'tag' gets stored in the result tuple
... t = monitor()
... for x in range(10):
... yield x # SystemError when the tuple needs to be resized
...
>>> tuple(my_iter())
(<object object at 0x00000217225091B0>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: C:\Users\User\src\cpython-dev\Objects\tupleobject.c:963: bad argument to internal function
>>> |
|