8000 bpo-44800: unobtrusively rename _PyInterpreterFrame to _Py_frame by ncoghlan · Pull Request #32024 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44800: unobtrusively rename _PyInterpreterFrame to _Py_frame #32024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Prev Previous commit
Next Next commit
ReST is not Markdown
  • Loading branch information
ncoghlan committed Mar 21, 2022
commit a8d3c9ec3a5f917ad4e48859f81bc4162f3136b3
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Renamed `_PyInterpreterFrame` as `_Py_frame` to emphasise its close
association with `PyFrameObject` (they're conceptually the same thing, but
Renamed ``_PyInterpreterFrame`` as ``_Py_frame`` to emphasise its close
association with ``PyFrameObject`` (they're conceptually the same thing, but
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "conceptually the same thing" mean?
They aren't the same thing. What is the concept that makes them the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same thing that makes it OK to pass both PyFrameObject and _PyInterpreterFrame structs to functions that have names starting with _PyFrame: they're Python code evaluation frames either way, but you may be working with the underlying data storage directly, or you may be working with the full refcounted Python object.

The difference between the two is mechanical (how their memory allocation is managed) rather than conceptual.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your concepts are just that, your concepts. They are highly subjective.

PyFrameObjects and _PyInterpreterFrame are different things. One is a reference counted heap object, the other a stack frame. They have to managed quite differently, to me that means they are "conceptually distinct".

split into a Python object struct and a C data struct as a performance
optimisation).

The `f_` prefix has been removed from all `_Py_frame` fields that previously
The ``f_`` prefix has been removed from all ``_Py_frame`` fields that previously
used it, so the presence or absence of the prefix provides a way to infer
the exact type of a frame pointer when reading an isolated snippet in a code
diff.
0