Message385213
https://bugs.python.org/issue41545 is a duplicate of this.
In that report, there's an example of something that can go wrong with the save-a-boolean-per-context-manager approach even when threads are not used, but when concurrent generators are used, like
def gen():
with gc_disabled():
yield 1
yield 2
yield 3
a = gen()
b = gen()
next(a) # disable gc
next(b)
list(a) # this re-enableds the gc
next(b) # gc is enabled but shouldn't be.
A counter for "number of times disabled" may be a better approach. |
|
Date |
User |
Action |
Args |
2021-01-18 18:18:48 | Dennis Sweeney | set | recipients:
+ Dennis Sweeney, rhettinger, gregory.p.smith, ncoghlan, pitrou, ned.deily, pmpp, eric.snow, serhiy.storchaka, yselivanov, josh.r, YoSTEALTH, bar.harel, lisroach, pablogsal |
2021-01-18 18:18:48 | Dennis Sweeney | set | messageid: <1610993928.2.0.384537118349.issue31356@roundup.psfhosted.org> |
2021-01-18 18:18:48 | Dennis Sweeney | link | issue31356 messages |
2021-01-18 18:18:48 | Dennis Sweeney | create | |
|