Been messing about with python, as usual it throws my rigid static typed Object Oriented world in to a bit of a mess. Python supports duck typing, has no usable concept of interface based programming (as in C# interfaces) and allows Global variables. With all these goodies is there really any point to a dependency injection container or does the Python run-time become the container.
I understand the point to these containers in static typed OO languages such as Java and C# but where would such a thing fit into the nutty world of python (I love it)?
I have always suspected that Dependency injection as a design pattern was a bad smell that has been created by everything must be a class "Nazi thinking" that is c# and Java, would i be correct or is there something I am missing?
So far I think I can cover factories, Singletons, Multi-instance objects, just by using Globals. I also suspect that the Aspect stuff is covered too, although I am still thinking about this.
The Duck Typing is the thing that is getting me at the moment, so used to defining interfaces then basing classes on these interfaces and letting the static stuff cover my stupidity that I feel that without static typing, containers are a bit useless.
edit
I think I won't be using Dependency Injector frameworks/containers when using python. There really isn't any point. After thinking and reading the responses so far, the argument is made clear that without static type definitions the promises made are so loose that why bother at all. Duck typing is what it is, and the only promise can be made through documentation. As long as the reference comes into the class Method / function through a signiture parameter, and not coming through the ether of the programming environment, then I think I will be safe.
Alarming though is the fact that I can not enforce my will on others through my over bearing design practices as I have done in Java and C#. Do I care......nah :)