
Nov. 29, 2016
2:48 a.m.
On Tue, Nov 29, 2016 at 12:14 PM, Steven D'Aprano <steve@pearwood.info> wrote:
What if I have two files?
# a.py try: import spam except ImportError: import ham as spam
# b.py try: import spam except ImportError: import cornedbeef as spam
In the same project? Then you already have a maintenance nightmare, because 'spam' will sometimes mean the same module (with state shared between the files), but might mean two distinct modules (and thus unrelated module objects). In different projects? They won't conflict. ChrisA