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

gh-127124: Pass optional state to context watcher callback #127140

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Nov 24, 2024

  1. pythongh-127124: Pass optional state to context watcher callback

    This enables users to associate state with the callback without
    relying on globals.
    
    Also:
      * Refactor the tests for improved readability and extensibility, and
        to cover the new state object.
      * Drop the pointer from the `PyContext_WatchCallback` typedef.  This
        de-obfuscates the fact that pointers are involved, and makes it
        possible to forward-declare functions to improve readability:
    
            static PyContext_WatchCallback my_callback;
    
            int
            my_callback(PyObject *cbarg, PyContextEvent event, PyObject *obj)
            {
                ...
            }
    rhansen committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    c9e95d4 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2024

  1. Configuration menu
    Copy the full SHA
    133e00c View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2024

  1. Configuration menu
    Copy the full SHA
    3e28b5f View commit details
    Browse the repository at this point in the history