On Sun, Aug 1, 2010 at 1:14 AM, Michael Foord <[email protected]> wrote:
> Some people workaround the potential for bugs caused by __main__ reimporting
> itself by doing it *deliberately*. Glyf even recommends it as good practise.
> ;-)
>
> http://glyf.livejournal.com/60326.html
>
> So - the fix you suggest would *break* this code. Raising a warning
> wouldn't... (and would eventually make this workaround unnecessary.)

With my change, that code would work just fine. "from myproject.gizmo
import main" and "from __main__ import main" would just return the
same object, whereas currently they return something different.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to