I have a module whose behaviour needs to be configurable. The module
needs to decide, the first time it is imported, beteween alternative
interfaces it presents.
Currently, I set some environment variables which select the desired
behaviour, and the module inspects those variables to determine the
mode in which it should set itself up. I would prefer a pure Python
solution, rather than one which depends on external state.
Can you recommend any approaches, or warn against the pitfalls of some
approaches?
needs to decide, the first time it is imported, beteween alternative
interfaces it presents.
Currently, I set some environment variables which select the desired
behaviour, and the module inspects those variables to determine the
mode in which it should set itself up. I would prefer a pure Python
solution, rather than one which depends on external state.
Can you recommend any approaches, or warn against the pitfalls of some
approaches?
Comment