Message282939
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. |
|
Date |
User |
Action |
Args |
2016-12-11 19:23:50 | brett.cannon | set | recipients:
+ brett.cannon, vinay.sajip, jaraco, ncoghlan, eric.araujo, Arfrever, eric.snow, serhiy.storchaka |
2016-12-11 19:23:50 | brett.cannon | set | messageid: <1481484230.82.0.331673613299.issue16737@psf.upfronthosting.co.za> |
2016-12-11 19:23:50 | brett.cannon | link | issue16737 messages |
2016-12-11 19:23:50 | brett.cannon | create | |
|