18.02.20 11:28, M.-A. Lemburg пише:
This sounds like a nice idea, but it may make sense to limit the
frame to one already on the stack. Otherwise, the code you're
executing may never return to your current stack...

I do not think there will be such problem. exec() will temporary replace the stack of frames before executing the code and restore the original stack after it be finished. Since the stack is implemented as a single-linked list, and multiple lists can share the same tail, it all should be zero-overhead.

OTOH, perhaps that could be regarded and used as a feature, similar
to what PyPy exposes:

https://doc.pypy.org/en/latest/stackless.html

Thank you for the link. It is interesting. The difference with PyPy is that I do not propose to create cycles. And since CPython uses the single C stack it has nothing with stackless and do not allow to get rid of the recursion depth limit. But there is something common in these ideas -- both work with f_back. Maybe more.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/MQQ547VS24A6TQ5MGX4CP2HKYIT74PXM/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to