> 2. The level at which the dependency injection works (function > arguments, class attributes, module globals) needs to be decided
+1. The scope of parameter needs to be specified. If the scope is global, this can be achieved pretty easily -- declare some of the imports in particular modules to be a part of the public APIs of that modules. Being part of the public API means allowing to replace that module with another one with compatible implementations. In other words, bless monkey-patching of those imports. The advantages of this is simplicity and no uglification of the code (no changes even). However, this should really not be used for more than just testing. For other purposes the scope should be smaller (e.g. class) and Antoine's approach looks like the right thing. Eugene _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com