➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 Mark.Shannon
收信人 Mark.Shannon
日期 2020-06-11.13:27:24
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1591882044.52.0.325483570174.issue40941@roundup.psfhosted.org>
In-reply-to
内容
This change combines the explicit state in `PyFrameObject.f_excuting` and `PyGenObject.gi_running`, and the implicit state in `PyFrameObject.f_stacktop == NULL` and `PyFrameObject.f_last == -1` into a single enum field in `PyFrameObject`.

Since we no longer need to test `PyFrameObject.f_stacktop == NULL` , The `f_stacktop` pointer can be replaced with a `f_stackdepth` integer, which make for simpler code when iterating over the stack and avoids the potential hazard of NULL pointers.

There are  three benefits to these changes:

1. The code is more robust and, IMO, easier to understand, as all state is now explicit.
2. It carries additional information about the state of the frame. Information about whether a frame exiting by `return` or by `raise` is available.
3. A modest reduction in size of frame and generator objects.
历史
日期 用户 动作 参数
2020-06-11 13:27:24Mark.Shannon修改recipients: + Mark.Shannon
2020-06-11 13:27:24Mark.Shannon修改messageid: <1591882044.52.0.325483570174.issue40941@roundup.psfhosted.org>
2020-06-11 13:27:24Mark.Shannon链接issue40941 messages
2020-06-11 13:27:24Mark.Shannon创建