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

Document PyInterpreterState_Main(). #80338

Closed
ericsnowcurrently opened this issue Mar 1, 2019 · 8 comments
Closed

Document PyInterpreterState_Main(). #80338

ericsnowcurrently opened this issue Mar 1, 2019 · 8 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir easy

Comments

@ericsnowcurrently
Copy link
Member

BPO 36157
Nosy @ericsnowcurrently, @miss-islington, @nanjekyejoannah
PRs
  • bpo-36157:Document PyInterpreterState_Main() #12238
  • [3.7] bpo-36157:Document PyInterpreterState_Main() (GH-12238) #12650
  • 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 2019-04-01.15:22:42.153>
    created_at = <Date 2019-03-01.16:36:40.689>
    labels = ['easy', '3.7', '3.8', 'docs']
    title = 'Document PyInterpreterState_Main().'
    updated_at = <Date 2019-04-01.15:22:42.152>
    user = 'https://github.com/ericsnowcurrently'

    bugs.python.org fields:

    activity = <Date 2019-04-01.15:22:42.152>
    actor = 'eric.snow'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-04-01.15:22:42.153>
    closer = 'eric.snow'
    components = ['Documentation']
    creation = <Date 2019-03-01.16:36:40.689>
    creator = 'eric.snow'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36157
    keywords = ['patch', 'easy']
    message_count = 8.0
    messages = ['336929', '336996', '337496', '339151', '339209', '339297', '339298', '339299']
    nosy_count = 4.0
    nosy_names = ['docs@python', 'eric.snow', 'miss-islington', 'nanjekyejoannah']
    pr_nums = ['12238', '12650']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36157'
    versions = ['Python 3.7', 'Python 3.8']

    @ericsnowcurrently
    Copy link
    Member Author

    PyInterpreterState_Main() is a function in the public C-API that returns a pointer to the main interpreter's state. The main interpreter is the first one created by the CPython runtime during startup (e.g. when the "python" command is run).

    Documentation for PyInterpreterState_Main() should be on the "Initialization, Finalization, and Threads" page of the C-API docs, probably in the "Sub-interpreter support" section. [1] It could also possibly go in the "Advanced Debugger Support" section. [2]

    FYI, I added PyInterpreterState_Main() at PyCon US 2017 (commit f5df46d) when I merged Nick Coghlan's internal implementation of PEP-432. So it has been available since 3.7.

    [1] https://docs.python.org/3/c-api/init.html#sub-interpreter-support
    [2] https://docs.python.org/3/c-api/init.html#advanced-debugger-support

    @ericsnowcurrently ericsnowcurrently added 3.7 (EOL) end of life 3.8 only security fixes labels Mar 1, 2019
    @ericsnowcurrently ericsnowcurrently added docs Documentation in the Doc dir easy labels Mar 1, 2019
    @nanjekyejoannah
    Copy link
    Member

    @Mariatta do you want to keep this for the mentored sprint at PyCon?

    @nanjekyejoannah
    Copy link
    Member

    Since there was no response, I decided to open a PR for this.

    @ericsnowcurrently
    Copy link
    Member Author

    As I noted on the PR, this might be a good chance to make sure the C-API docs are clear about what the "main" interpreter is.

    @nanjekyejoannah
    Copy link
    Member

    I will work on this in a separate PR.

    I opened #bpo-36487 (https://bugs.python.org/issue36487) to track this.

    @miss-islington
    Copy link
    Contributor

    New changeset 8c61739 by Miss Islington (bot) (Joannah Nanjekye) in branch 'master':
    bpo-36157:Document PyInterpreterState_Main() (GH-12238)
    8c61739

    @miss-islington
    Copy link
    Contributor

    New changeset 35fc38e by Miss Islington (bot) in branch '3.7':
    bpo-36157:Document PyInterpreterState_Main() (GH-12238)
    35fc38e

    @ericsnowcurrently
    Copy link
    Member Author

    Thanks for working on this, Joannah! :)

    @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 docs Documentation in the Doc dir easy
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants