Re:Data structures and algorithms I actually used while work...
by eru on Friday July 24, 2020 @08:22AM
(#23938605)
Oh, yes, I was only saying that as far as the Python language is concerned the tuple packing is in the tail position.
Any specific implementation, and in this case cpython, could do arbitrary weird things after.
Thanks for looking up the code!
Looking at https://github.com/python/cpython/blob/master/Python/ceval.c, here is the code that needs to be executed after the tuple is constructed:
I guess you could duplicate all this code in a special "pack tuple and return from Python function" C function which you could then really tail call.