Sharing this again because Emlyn O’Regan has completed the series with Part 4.
The idea behind this series of articles is to enable serialization of Python functions so they can be pushed out and run on remote servers. The wrinkle is that functions that use recursion have to reference themselves in a closure and this makes them not easy to serialize.
Emlyn shows the process of working around this limitation by using the venerable Y-Combinator to allow fully serializable recursive functions.
Part 1
https://medium.com/@emlynoregan/serialising-all-the-functions-in-python-cd880a63b591#.ej8h56229
Part 2
Part 3
Part 4
Originally shared by Emlyn O’Regan
This is part 1 of 2 of 4. In part 2 the other parts I’ll present what appears to be a novel approach to serialising recursive inner functions in Python using the Y Combinator.