◐ Shell
clean mode source ↗

gh-91053: Add an optional callback that is invoked whenever a function is modified by mpage · Pull Request #98175 · python/cpython

JIT compilers may need to invalidate compiled code when a function is
modified (e.g. if its code object is modified). This adds the ability
to set a callback that, when set, is called each time a function is
modified.

@mpage mpage changed the title Add an optional callback that is invoked whenever a function is modified gh-91053: Add an optional callback that is invoked whenever a function is modified

Oct 11, 2022

@mpage mpage marked this pull request as ready for review

October 12, 2022 15:49

erlend-aasland

- Imperative mood
- Semantic line breaks

erlend-aasland

markshannon

carljm

erlend-aasland

@mpage

A bit is set in the bit vector iff there is a watcher set at the
corresponding offset in the watcher array. Only notify watchers
if at least one bit is set.

erlend-aasland

markshannon

facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull request

Jun 27, 2023
Summary:
Backport function watchers from upstream 3.12 (cf python/cpython#98175, although I backported from latest 3.12 branch, which has had a few modifications.)

This diff doesn't use the new API yet; I'll do that in a separate stacked diff.

Reviewed By: DinoV

Differential Revision: D46993187

fbshipit-source-id: 35f3a0f86f6f0e2764205d4c865e1fb5efb69314