With my recent dedicated introduction to the Python language, I have become very appreciative of the highly composable nature of WSGI applications.
In a functional style, you are able to compose a desired application from many different components, using the middleware ideology.
The benefits of this approach can be clearly seen in the contrived example depicted below, which is based on my previous Flask example.
Understanding Python WSGI with Examples
Coming from a strong PHP background, initially, exploring the web development landscape whilst delving into Python seemed rather confusing.
As Python was not originally developed for the web, a specification called PEP 333 was accepted, which standardised the required interface between web servers and Python web frameworks/applications.
Despite the additional complexity, the manner in which middleware applications can be integrated, along with the server choices, offers possibilities that I find hard to locate a comparable alternative for in PHP.