Message387033
> IMO the unsafe PyTuple_New() API should be avoided.
Is not that simple, there are other APIs that track the tuple as _PyTuple_Resize. This problem also is not unique to tuples, although is mainly prominent in them.
We have this warning in the docs:
>> Care must be taken when using objects returned by get_referrers() because some of them could still be under construction and hence in a temporarily invalid state. Avoid using get_referrers() for any purpose other than debugging.
That's because *by thesign* these APIs can potentially access half-initialized objects.
I don't know if is worth to add a new API just for tuples, given that this problem happens with many other objects |
|
Date |
User |
Action |
Args |
2021-02-15 17:58:07 | pablogsal | set | recipients:
+ pablogsal, arigo, jcea, ghaering, amaury.forgeotdarc, pitrou, vstinner, lkraav, pxd, iritkatriel |
2021-02-15 17:58:06 | pablogsal | set | messageid: <1613411886.98.0.0984646568274.issue15108@roundup.psfhosted.org> |
2021-02-15 17:58:06 | pablogsal | link | issue15108 messages |
2021-02-15 17:58:06 | pablogsal | create | |
|