News for hackers. Stuff that matters.
Re:Python goto implemented with system trace function (2017) by tom_mellior on Tuesday May 05, 2020 @02:52PM (#23083421)
With a decorator you can parse and rewrite the function's bytecode. If it helps, I'm fairly sure you could also ask for the function's abstract syntax tree, rewrite that, and ask for it to be compiled. So you could build something, but every function using such gotos would have to be decorated with @gotos or whatever.
Re:Python goto implemented with system trace function (2017) by fezzez on Tuesday May 05, 2020 @07:21PM (#23086253)
^To add to that. I'm doing exactly that to build this tool that lets you add logging statements onto running python without any restarts.

CPython gives you all the necessary utilities to let you freely manipulate pretty much any function's bytecode.