GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve "Extending Python with C or C++" docs · Issue #93677 · python/cpython

Improve "Extending Python with C or C++" docs #93677

New issue
Copy link
New issue
Copy link
Open
Open
Improve "Extending Python with C or C++" docs#93677
Copy link
Assignees
encukou
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-C-API

Description

@erlend-aasland
erlend-aasland
opened on Jun 10, 2022
Issue body actions

Quoting Petr in issue gh-93078:

Anyway, the more important thing to do here is converting the tutorial. That will, in my opinion, make the new way official :)
But I don't want to do that until PEP 687 is accepted, and more PEP 630 open issues are solved. (FWIW: Metaclasses and Per-class scope look like they could go in anearly 3.12 alpha, Type checking should hopefully go in 3.12 as well, and lossless conversion isn't blocking for me.)

But yes, all that is out of scope of this PR.

Originally posted by @encukou in #93078 (comment)

Reacted by Eric Snow

Activity

  1. erlend-aasland
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    topic-C-API
    on Jun 10, 2022
  2. encukou
    self-assigned this
    on Jun 10, 2022
  3. encukou commented on Oct 13, 2023

    @encukou
    encukou
    on Oct 13, 2023
    Member
    More actions

    cc @ericsnowcurrently

  4. elmbeech commented on Feb 8, 2024

    @elmbeech
    elmbeech
    on Feb 8, 2024
    More actions

    Hello!
    I have just written my first extended python module. Thank you for the documentation, it was a good help! A minor thing I found in the example code, that I think, should be different.
    Under 1. Extending Python with C or C++ : 1.1. A Simple Example , 1.2. Intermezzo: Errors and Exceptions, and 1.3. Back to the Example.

    • https://docs.python.org/3/extending/extending.html
    static PyObject *
    spam_system(PyObject *self, PyObject *args)
    {
        const char *command;
        int sts;
    
        if (!PyArg_ParseTuple(args, "s", &command))
            return NULL;
        sts = system(command);
        return PyLong_FromLong(sts);
    }

    Should return NULL; not better be return Py_None;?

  5. erlend-aasland commented on Feb 8, 2024

    @erlend-aasland
    erlend-aasland
    on Feb 8, 2024
    ContributorAuthor
    More actions

    should return NULL; not better be return Py_None;?

    Take a look at the immediately following section (1.2 Intermezzo: Errors and Exceptions), where this is explained.

  6. elmbeech commented on Feb 8, 2024

    @elmbeech
    elmbeech
    on Feb 8, 2024
    More actions

    thank you! and sorry if this is just because I not understood everything.

    Reacted by Erlend E. Aasland and elmar bucher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @encukou
    encukou

Labels

docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-C-API

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.