Setuptools, __init__ and __main__

Ethan Furman ethan at stoneleaf.us
Fri Feb 6 18:21:52 EST 2015


On 02/06/2015 02:56 PM, Ben Finney wrote:
> 
> It's not Setuptools per se, it's Python's import mechanism. It is a
> deliberate design decision that direct import of a module makes that
> module blind to its location in the package hierarchy.
> 
> That's a design decision I deplore, because it makes something that
> should be easy (write a command directly into a file and invoke that
> file as an executable program) tortuously difficult when the program
> comprises several modules.

Can you explain that a bit more?  Surely if the writing a command into a file was going to be easy, then so would be
writing it to __main__.py instead?

--
~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/c7788c6d/attachment.sig>


More information about the Python-list mailing list