On Tue, Nov 29, 2016 at 12:14 PM, Steven D'Aprano <st...@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
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to