TIL About Python stacktraces
traceback.print_stack() can be used to print the current stacktrace from anywhere within a running python program
# print the stacktrace on ctrl+c on unix
signal.signal(signal.SIGUSR1, lambda: traceback.print_stack())
References
- Link incoming, I learned this at Pycon UK 2025