[PEP 558 - WIP] bpo-30744: Trace hooks no longer reset closure state by ncoghlan · Pull Request #3640 · python/cpython

@ncoghlan ncoghlan changed the title [DO NOT MERGE - PEP 558] bpo-30744: Trace hooks no longer reset closure state [PEP 558 - DO NOT MERGE] bpo-30744: Trace hooks no longer reset closure state

Sep 18, 2017

@ncoghlan

Previously, trace hooks running on a nested function
could incorrectly reset the state of a closure cell.

This avoids that by slightly changing the semantics
of the locals namespace in functions, generators,
and coroutines, such that closure references are
represented in the locals namespace by their
actual cell objects while a trace hook implemented
in Python is running.

Depends on PEP 558 and bpo-17960 to cover the
underlying change to frame.f_locals semantics.

ZackerySpytz

auvipy

@ncoghlan

@ncoghlan

@ncoghlan

@erlend-aasland erlend-aasland added pending

The issue will be closed if no feedback is provided

and removed pending

The issue will be closed if no feedback is provided

labels

Jul 24, 2022

@github-actions github-actions bot added stale

Stale PR or inactive for long period of time.

and removed stale

Stale PR or inactive for long period of time.

labels

Aug 24, 2022