Imagine there are two files horse.py and buffalo.py. horse.py is imported by
another file rider.py. Is it possible to make it so that under certain
circumstances possibly based on an environment variable or something similar
that when rider.py imports horse.py, it actually imports buffalo.py sort of
like a behind the scenes replacement so that rider.py needs little,
preferably absolutely no modification? Right now, I am investigating the use
of sys.modules and doing something using sys.modules['horse.py'] =
'buffalo.py'.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to