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.

classification
Title: confusion between frame and frame_summary in traceback module
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: chris.jerdonek, iritkatriel
Priority: normal Keywords: patch

Created on 2021-09-01 11:45 by iritkatriel, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28112 merged iritkatriel, 2021-09-01 13:22
Messages (8)
msg400825 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-01 11:45
def format_frame(frame) should be renamed to format_frame_summary(frame_summary) because it takes a FrameSummary obejct and not a frame. 

This is a new API in 3.11 so it can be changed now.

There are also local variables in traceback.py which are called frame but actually represent FrameSummary. This can be confusing and should be fixed at the same time where it doesn't break API.
msg400827 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-01 12:09
There are places where f is used for an arg or local variable which is a frame, so I'll try f_summary when it's a FrameSummary.
msg400841 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2021-09-01 15:14
It might be good to have consistency with what will be used for StackSummary so two different approaches to naming aren't used.

By the way, frame_sum is another possibility since I see frame_gen being used.
msg400842 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-01 15:19
I'm not sure I follow. We don't have a similar issue with StackSummary - there is no interpreter type for "stack" that you can confuse it with.
msg400849 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2021-09-01 15:57
I was suggesting keeping more similarity between FrameSummary and StackSummary in addition to differentiating frame from FrameSummary. Since stack is used for StackSummary, frame_sum is more similar than f_summary while still providing the differentiation.
msg400861 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2021-09-01 17:15
Or frame_info (more readable), since FrameSummary is proposed to be "Information about a single frame from a traceback."
msg400862 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-01 17:42
Yes, frame_info is good.
msg401018 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-03 21:39
New changeset 0b58e863df9970b290a4de90c67f9ac30c443817 by Irit Katriel in branch 'main':
bpo-45075: distinguish between frame and FrameSummary in traceback mo… (GH-28112)
https://github.com/python/cpython/commit/0b58e863df9970b290a4de90c67f9ac30c443817
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89238
2021-09-03 21:41:37iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-09-03 21:39:31iritkatrielsetmessages: + msg401018
2021-09-01 17:42:57iritkatrielsetmessages: + msg400862
2021-09-01 17:15:44chris.jerdoneksetmessages: + msg400861
2021-09-01 15:57:28chris.jerdoneksetmessages: + msg400849
2021-09-01 15:19:56iritkatrielsetmessages: + msg400842
2021-09-01 15:14:17chris.jerdoneksetnosy: + chris.jerdonek
messages: + msg400841
2021-09-01 13:22:15iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request26553
2021-09-01 12:09:54iritkatrielsetmessages: + msg400827
2021-09-01 11:45:44iritkatrielcreate