One of my favorite design patterns is the middleware stack—providing a simple API that is meant to be “wrapped” by a new object implementing the same API. Makes it very easy to add&reuse functionality with minimal coupling between components. Equally useful in web servers and ML.
New article on #python decorators is out! Specifically this shows you how decorators are written, what they do, and the power you can do with them. I even show an example of when you'd use the strange "nonlocal" 1/3
https://t.co/F1K1Gn4b0S... See more