Paste that into a Python 3 interpreter, you should see "55". Somewhere in there is the Y-contaminator and several other tricks similar to what this article describes.
Re:One-lined Python
by xamuel on Thursday August 22, 2019 @12:01PM
(#20769532)
If you like that sort of thing, try doing similar code for the Ackermann function [1]. In a certain sense that can be made semi-formal, if you can do this sort of thing for the Ackermann function, then you can do it for almost anything.
Re:One-lined Python
by sethgecko on Thursday August 22, 2019 @11:08AM
(#20768920)
If you want your mind to blow up I recommend watching this year's "Lambda Calculus from the Ground Up" PyCon talk by the wizard David Beazley https://www.youtube.com/watch?v=pkCLMl0e_0k
> Your code could not be one-lined. name 'reduce' is not defined
Never quite understood that decision
Instead of reduce, you could use https://docs.python.org/3/library/functions.html#__import__
https://en.wikipedia.org/wiki/Ackermann_function
In my head I read this in the voice of Harry Dean Stanton (Repo Man).