Topic

Introduction to dependency injection and testable code
By: Adrian Garcia Badaracco
Date: Oct. 13, 2022, 6 p.m.

Isn't dependency injection a Java thing? Not really!

Have you used Pytest? Fixtures are a form of dependency injection. What about just passing in file-like object to `json.load`? Also dependency injection! There's also FastAPI, one of the most popular Python web frameworks now days, that has depedendency injection as one of it's key features.

You see, dependency injection is very widespread in the Python world, it just looks so natual because of lack of a `new` keyword and first-class function support that you might not even know you are using the technique. Nonetheless it can help to be aware of the theory and jargon around it, which is what we'll explore in this talk by way of a joint refactoring exercise.