A Python implementation that does not use the C stack