> Later polymorphism is used (in tests) to overwrite the class method's.

No problem, you can use references to modules just the way you use references to class instances. Example:

```python
import dpkg_environment
import yum_environment

if options.environment == 'dpkg':
    env = dpkg_environment
elif options.environment == 'yum':
    env = yum_environment
elif options.environment == 'auto':
    env = autodetect_env()
```

> Please include an docstring example in the guidelines.

OK, I will.