Skip to content

bpo-29917: DOC: Remove link from PyMethodDef (#890) - #895

Merged
orsenthil merged 1 commit into
python:3.5from
orsenthil:backport-c3c7ef0-3.5
Mar 30, 2017
Merged

orsenthil merged 1 commit into
python:3.5from
orsenthil:backport-c3c7ef0-3.5

Conversation

@orsenthil

Copy link
Copy Markdown
Member

(cherry picked from commit c3c7ef0)

@orsenthil
orsenthil merged commit d1dbbaa into python:3.5 Mar 30, 2017
parawanderer added a commit to parawanderer/cpython that referenced this pull request Oct 20, 2026
window-ml PYTHON_DIALECT.md python#895, replacing 2026-10-15's "restriction is a property of
the entry": a CO_RESTRICTED frame entered while no run is active (not restricted, not
lifted) raises NotInDialect, so a function a cell defined runs nowhere the gate does
not. The check is a tier-1 op at RESUME (_RESTRICTED_ENTRY, in RESUME and
INSTRUMENTED_RESUME), which every route into such code passes: a call, a C library
calling it back from host code, exec() of its code, and a generator's or coroutine's
resumption. RESUME_CHECK deopts on CO_RESTRICTED code and _QUICKEN_RESUME leaves it
unquickened, so a specializing build takes the same check.

The text names the function as the cell wrote it and says what to do: "f() was
defined in a cell that ran inside the read-only dialect, unasked, and runs only
there; define it again in this cell to call it here".

Tests (OutsideRunTest): each route, a nested function, the name without the wrapper's
"_user.<locals>.", and host code untouched; two tests that pinned the old rule now
assert the refusal. Mutation: without the op in RESUME, 9 of 145 fail.

Cost, native arm64 build, 9 interleaved runs, median of best-of-5: 2M calls
95.7 -> 97.0 ms (+0.6 ns/call, x1.013); 2M generator resumptions 64.1 -> 63.2 ms
(x0.986). Both within the runs' spread (90-98 and 95-100 ms; 63-67 and 62-65 ms).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants