Setuptools, __init__ and __main__

Ethan Furman ethan at stoneleaf.us
Fri Feb 6 17:51:29 EST 2015


On 02/06/2015 02:20 PM, Rob Gaddi wrote:
> 
> My library code isn't in __init__.py (or previously in __main__) because 
> I'm trying to dodge recursive imports; it's there because the code is 
> short enough and tightly-coupled enough that I didn't see upside in 
> splitting any of it out to a separate file.  Under other circumstances 
> when the app has become substantial, the bulk of the application code 
> winds up in, e.g. mainwindow.py, and the __main__ does nothing but call 
> mainwindow.main().

Sounds like you would have been okay to keep your code in __main__.py and have an empty __init__.py.

--
~Ethan~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20150206/d8319734/attachment.sig>


More information about the Python-list mailing list