This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients Arfrever, brett.cannon, eric.araujo, eric.snow, jaraco, ncoghlan, serhiy.storchaka, vinay.sajip
Date 2016-12-11.19:23:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481484230.82.0.331673613299.issue16737@psf.upfronthosting.co.za>
In-reply-to
Content
Maybe we just need to clarify some documentation at this point? All of the differences in semantics make total sense when you realize `-m pkg` is really conceptually shorthand for `import pkg.__main__` (w/ the appropriate __name__ flourishes). When you begin to view it that way then specifying the file path starts to look like the odd way by bypassing import and simply running open() on a file and passing the result to exec() (once again, with the appropriate __name__ flourishes). It also makes the point that -m isn't really shorthand for specifying a script which seems to be where people are getting tripped up by the differences.

So instead of selling `-m` as a way to run a module/package as a script, I say we change the message/documentation to say it does an import with __name__ changed and make specifying a script as the weird reading-a-file-directly thing.
History
Date User Action Args
2016-12-11 19:23:50brett.cannonsetrecipients: + brett.cannon, vinay.sajip, jaraco, ncoghlan, eric.araujo, Arfrever, eric.snow, serhiy.storchaka
2016-12-11 19:23:50brett.cannonsetmessageid: <1481484230.82.0.331673613299.issue16737@psf.upfronthosting.co.za>
2016-12-11 19:23:50brett.cannonlinkissue16737 messages
2016-12-11 19:23:50brett.cannoncreate