On Sun, Aug 1, 2010 at 1:14 AM, Michael Foord <fuzzyman at voidspace.org.uk> 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 | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4