python / cpython

The Python programming language
https://www.python.org
Other
63.65k stars 30.49k forks source link

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

Open rhansen opened 3 days ago

rhansen commented 3 days ago

This enables users to associate state with the callback without relying on globals.

Also:

This will conflict with #124741; if one is merged I'll rebase the other.


📚 Documentation preview 📚: https://cpython-previews--127140.org.readthedocs.build/

ZeroIntensity commented 1 day ago

FWIW, no need to force push changes--it makes reviewing harder. It's fine to just commit normally, and then everything gets squashed.

rhansen commented 15 hours ago

Force pushing is the only way to update the commit message.

ZeroIntensity commented 10 hours ago

Yes, but it makes reviewing more difficult. FWIW, nobody really cares about the commit messages in the PR itself, the end message that gets squashed is really what matters. (There's a section in the devguide about this, IIRC.)