How to continue normal processing when using errcheck protocol in ctypes

Open Beginner friendly
#112,423 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Start at the ctypes errcheck documentation section linked in the issue and compare it with the referenced _ctypes.c comment. Document that returning the unchanged arguments parameter continues normal processing, then build or check the ctypes documentation to confirm the wording and formatting.

Written by the indexing model from the issue text.

Description

docs topic-ctypes

Documentation

At https://docs.python.org/3/library/ctypes.html#ctypes._FuncPtr.errcheck there isn't explained what to return to continue with normal processing of the foreign function result (parameter(s) flagged as input/output or output parameters are returned instead of the actual ffi result value).

It should be added that returning the arguments parameter, the usual processing continues.

See code comment:

    /* If the errcheck function failed, return NULL.
       If the errcheck function returned callargs unchanged,
       continue normal processing.
       If the errcheck function returned something else,
       use that as result.
    */
Dominant language
Python
Stars
77.2k
Forks
36k
Avg merge
1d 10h
Merged PRs (30d)
560

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python/cpython

All issues in python/cpython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.