super() considered a case for dependency injection
In following of python super() considered harmfull and __super()__ considered __super()__
by Raymond Hettinger Blog Video I came to the idea to use it for dependency injection.
__super()__
If you haven't seen and used __super()__
before, see the video from Hettinger or the docs.python . In short returns a object that delegates method calls to a parent or sibling of the same type.
Dependency Injection
For those unaware of the term Dependency Injection or DI for short. It is a pattern to to decouple dependencies (it can be a database, file, class or function) from a certain implementation. So it makes it easier to test or to change later on.
Reason to use __super()__
For a small project (<150 hrs) I was working on, I wanted to achieve the following - Write production code (obviously) - Write Tests (Unit and Integration) - Unit Tests should be independent from production - Writing tests should be easy - No clunky adjustment to production code in order to make the testing easy 1 - Unittest should be fast - Tests should be independent of production data