Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul of Doc/library/__main__.rst #88660

Closed
jdevries3133 mannequin opened this issue Jun 23, 2021 · 4 comments
Closed

Overhaul of Doc/library/__main__.rst #88660

jdevries3133 mannequin opened this issue Jun 23, 2021 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@jdevries3133
Copy link
Mannequin

jdevries3133 mannequin commented Jun 23, 2021

BPO 44494
Nosy @cameron-simpson, @iritkatriel, @jdevries3133
PRs
  • bpo-44494: rewrite __main__.rst #26867
  • bpo-39452: rewrite and expand __main__.rst #26883
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-06-23.11:57:29.703>
    created_at = <Date 2021-06-23.03:29:41.683>
    labels = ['3.7', '3.8', '3.9', '3.10', '3.11', 'type-feature', 'docs']
    title = 'Overhaul of Doc/library/__main__.rst'
    updated_at = <Date 2021-06-23.19:25:40.251>
    user = 'https://github.com/jdevries3133'

    bugs.python.org fields:

    activity = <Date 2021-06-23.19:25:40.251>
    actor = 'jack__d'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-06-23.11:57:29.703>
    closer = 'jack__d'
    components = ['Documentation']
    creation = <Date 2021-06-23.03:29:41.683>
    creator = 'jack__d'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44494
    keywords = ['patch']
    message_count = 4.0
    messages = ['396380', '396387', '396410', '396412']
    nosy_count = 4.0
    nosy_names = ['cameron', 'docs@python', 'iritkatriel', 'jack__d']
    pr_nums = ['26867', '26883']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44494'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

    @jdevries3133
    Copy link
    Mannequin Author

    jdevries3133 mannequin commented Jun 23, 2021

    I made a proposal on discourse to redraft Doc/library/main.rst as it is currently quite terse and there have been a series of bpo's asking for more. See my discourse post:

    https://discuss.python.org/t/proposed-overhaul-of-main-py-documentation-doc-library-main-rst/9344
    ================
    There have been many complaints about the shortcoming of the documentation
    towards informing users about __main__. Both the popular __name__ == '__main__' construct, and the role of __main__.py in a python module.

    bpo-17359
    bpo-24632
    bpo-38452

    I propose a broad overhaul of Doc/library/main.rst to address these
    shortcomings and to provide a single source of truth on __main__ (in
    general!). This is an appropriate place to put this information.
    Both the __name__ == '__main__' and fooModule/main.py
    constructs reasonably fall under the category of “Python Runtime Services,”
    because they both control the way that programs run depending on how they are
    used (command-line versus import versus running directly).

    The new Doc/library/main.rst should have a new synopsis of, “CLIs,
    import-time behavior, and if __name__ == ‘main’”, reflecting its new and
    broader focus.

    Additionally, the new docs should have the following distinct sections:

    Differentiating between __name__ == ‘__main__’ and __main.__.py
    __main__.py and the -m flag (this is roughly what is there already, although
    it’s not as descriptive as it should be).
    __name__ and the if __name__ == '__main__' construct.
    

    If there is interest, I would be happy to open uptake this work on as soon as there is
    consensus around this plan. I’m looking forward to hearing what you think!
    ================

    Anyway, I have a first draft ready. I'm sure there will be plenty of feedback, so let it rip! I will open a GitHub PR and attach it to this bpo in just a moment.

    @jdevries3133 jdevries3133 mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jun 23, 2021
    @jdevries3133 jdevries3133 mannequin assigned docspython Jun 23, 2021
    @jdevries3133 jdevries3133 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jun 23, 2021
    @jdevries3133 jdevries3133 mannequin assigned docspython Jun 23, 2021
    @jdevries3133 jdevries3133 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Jun 23, 2021
    @iritkatriel
    Copy link
    Member

    Hi Jack,

    I'm not sure it's necessary to create a new issue for "Overhaul of Doc/library/main.rst" when we already have bpo-39452 to "Improve the __main__ module documentation" and bpo-24632 to "Improve documentation about __main__.py". What we really need to is close all but one of them as duplicates and consolidate the work. Also, the people who are on the nosy lists of the previous issues will not necessarily see the discussion you opened on this one if you won't alert them to it.

    Have you looked at the open PR on bpo-39452? I think there may be some overlap with what you did here (but I didn't check in any detail).

    @jdevries3133
    Copy link
    Mannequin Author

    jdevries3133 mannequin commented Jun 23, 2021

    @iritkatriel, ok, I will close this issue, close PR26867, and move the work I have over there. I probably can merge in and build upon the work from the contributor on bpo-39452.

    @jdevries3133 jdevries3133 mannequin closed this as completed Jun 23, 2021
    @jdevries3133 jdevries3133 mannequin closed this as completed Jun 23, 2021
    @iritkatriel
    Copy link
    Member

    That's a good plan!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant