[issue39452] Improve the __main__ module documentation

2021-11-06 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset e53cb9811f97ded5a20872fe0f3486bc7f8f1b6e by Miss Islington (bot) in branch '3.10': bpo-39452: [doc] Change "must" to "can" on relative import style in `__main__` (GH-29379) (GH-29449)

[issue39452] Improve the __main__ module documentation

2021-11-06 Thread miss-islington
Change by miss-islington : -- pull_requests: +27704 pull_request: https://github.com/python/cpython/pull/29449 ___ Python tracker ___

[issue39452] Improve the __main__ module documentation

2021-11-06 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 57457a1e5caf714034a75fe4f382b8b669ce6ed8 by Andre Delfino in branch 'main': bpo-39452: [doc] Change "must" to "can" on relative import style in `__main__` (GH-29379)

[issue39452] Improve the __main__ module documentation

2021-11-06 Thread Andrés Delfino
Change by Andrés Delfino : -- nosy: +adelfino nosy_count: 11.0 -> 12.0 pull_requests: +27703 pull_request: https://github.com/python/cpython/pull/29379 ___ Python tracker ___

[issue39452] Improve the __main__ module documentation

2021-09-09 Thread Nick Coghlan
Nick Coghlan added the comment: These changes are excellent - thanks for the patch! Something even the updated version doesn't cover yet is directory and zipfile execution, so I filed bpo-45149 as a follow up ticket for that (the info does exist elsewhere in the documentation, so it's

[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Géry
Géry added the comment: No worries, it was almost twenty years ago. > But it's probably better to raise a dedicated exception in that case and > catch it in main(), rather than just calling sys.exit() deep inside the other > code. Yes I agree, and I think you explained very clearly why it

[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Jack DeVries
Jack DeVries added the comment: > Your docs seem to promote the second, whereas I've usually preferred the > former. Was this a considered choice on your part? First and foremost, stupid GitHub is not letting the permalink load for some reason, but yes; this was discussed in the conversation

[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Guido van Rossum
Guido van Rossum added the comment: You're right, I'm being inconsistent. :-( I withdraw my objection. There are cases where sys.exit() is easier than returning an exit code, e.g. when the error is discovered deep inside some other code. But it's probably better to raise a dedicated

[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Géry
Géry added the comment: @jack__d Thanks for the rewrite! This is a great expansion. Unfortunately I didn’t have the time to review it before the merge. If I find something to be improved I will let you know. @gvanrossum > Your docs seem to promote the second, whereas I've usually preferred

[issue39452] Improve the __main__ module documentation

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks, the rewrite is great! I have one nit: did you consider which of these two idioms is better? if __name__ == "__main__": main() vs. if __name__ == "__main__": sys.exit(main()) Your docs seem to promote the second, whereas I've usually

[issue39452] Improve the __main__ module documentation

2021-08-24 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks a lot, Géry and Jack! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 ___ Python tracker

[issue39452] Improve the __main__ module documentation

2021-08-24 Thread miss-islington
miss-islington added the comment: New changeset ec5a03168f02ef92f98a94796bc6378fc73622e8 by Miss Islington (bot) in branch '3.10': bpo-39452: Rewrite and expand __main__.rst (GH-26883) https://github.com/python/cpython/commit/ec5a03168f02ef92f98a94796bc6378fc73622e8 --

[issue39452] Improve the __main__ module documentation

2021-08-24 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 7cba23164cf82f6619db002cd30021b5dfb1f809 by Jack DeVries in branch 'main': bpo-39452: Rewrite and expand __main__.rst (#26883) https://github.com/python/cpython/commit/7cba23164cf82f6619db002cd30021b5dfb1f809 -- nosy: +lukasz.langa

[issue39452] Improve the __main__ module documentation

2021-08-24 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26381 pull_request: https://github.com/python/cpython/pull/27932 ___ Python tracker

[issue39452] Improve the __main__ module documentation

2021-08-10 Thread Jack DeVries
Jack DeVries added the comment: Hi All, I'm pinging everyone here on the bpo because my GitHub PR has been through a lot of revision and review. Maybe it's close to being ready to merge (I hope)! Feel free to take a look if you are interested: https://github.com/python/cpython/pull/26883

[issue39452] Improve the __main__ module documentation

2021-06-23 Thread Zachary Ware
Change by Zachary Ware : -- versions: -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39452] Improve the __main__ module documentation

2021-06-23 Thread Jack DeVries
Change by Jack DeVries : -- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___ ___

[issue39452] Improve the __main__ module documentation

2021-06-23 Thread Jack DeVries
Jack DeVries added the comment: Hi All, As I wrote on the PR:: I am picking up the torch on 39452, continuing where @maggyero left off, and also implementing my discourse proposal, which seemed to be well-liked. Feel free to leave any feedback for me on the GitHub PR, I'm

[issue39452] Improve the __main__ module documentation

2021-06-23 Thread Jack DeVries
Change by Jack DeVries : -- keywords: +patch nosy: +jack__d nosy_count: 6.0 -> 7.0 pull_requests: +25460 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26883 ___ Python tracker

[issue39452] Improve the __main__ module documentation

2021-06-20 Thread Cameron Simpson
Change by Cameron Simpson : -- nosy: +cameron ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39452] Improve the __main__ module documentation

2021-06-19 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39452] Improve the __main__ module documentation

2021-06-19 Thread Irit Katriel
Irit Katriel added the comment: See also Issue24632 and Issue17359. -- nosy: +iritkatriel ___ Python tracker ___ ___

[issue39452] Improve the __main__ module documentation

2020-09-17 Thread Géry
Géry added the comment: I agree with you Terry. Another thing that bothers me: in the current document, the __main__ module is reduced to its environment (aka context or dictionary), whereas a module object has other important attributes such as its code. So how about adding the following

[issue39452] Improve the __main__ module documentation

2020-09-17 Thread Terry J. Reedy
Terry J. Reedy added the comment: The main issue I have with the existing doc is its use of 'top-level' to mean the main, initial, startup module that first executes the user code for a python 'program'. We routinely use 'top-level' instead for the global scope of a module. Example:

[issue39452] Improve the __main__ module documentation

2020-09-16 Thread Géry
Géry added the comment: Thanks for your extended review Steven. > You state that these two phrases are from the runpy documentation: > > * "run from the module namespace" > * "run from the file system" > > but neither of those phrases appear in the runpy documentation here: > >

[issue39452] Improve the __main__ module documentation

2020-01-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: There are some serious problems with the PR. You state that these two phrases are from the runpy documentation: * "run from the module namespace" * "run from the file system" but neither of those phrases appear in the runpy documentation here:

[issue39452] Improve the __main__ module documentation

2020-01-25 Thread Géry
New submission from Géry : This PR will apply the following changes on the [`__main__` module documentation](https://docs.python.org/3.7/library/__main__.html): - correct the phrase "run as script" by "run from the file system" (as used in the