Message411380
| Author |
kumaraditya |
| Recipients |
Mark.Shannon, corona10, eric.snow, gvanrossum, kumaraditya, vstinner |
| Date |
2022年01月23日.15:52:24 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1642953144.6.0.00811454326365.issue46476@roundup.psfhosted.org> |
| In-reply-to |
| Content |
> Be careful, Python must remain usable after Py_Finalize(): it's legit to call Py_Initialize() again and execute new Python code. Example executing the same code 4 times, each time Py_Initialize() and Py_Finalize() are called:
./Programs/_testembed test_repeated_init_exec 'print("Hello")'
With the current design, it isn't possible though because the code objects are modified in place so if co_quickened is freed the VM still tries to execute the copied instructions.
See https://github.com/python/cpython/blob/76dc047a0e88d10aad0405228d56e94438cdd91c/Python/specialize.c#L425 |
|