Skip to content
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

confusion between frame and frame_summary in traceback module #89238

Closed
iritkatriel opened this issue Sep 1, 2021 · 9 comments
Closed

confusion between frame and frame_summary in traceback module #89238

iritkatriel opened this issue Sep 1, 2021 · 9 comments

Comments

@iritkatriel
Copy link
Member

BPO 45075
Nosy @cjerdonek, @iritkatriel
PRs
  • bpo-45075: distinguish between frame and FrameSummary in traceback mo… #28112
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-09-03.21:41:37.386>
    created_at = <Date 2021-09-01.11:45:44.455>
    labels = []
    title = 'confusion between frame and frame_summary in traceback module'
    updated_at = <Date 2021-09-03.21:41:37.385>
    user = 'https://github.com/iritkatriel'

    bugs.python.org fields:

    activity = <Date 2021-09-03.21:41:37.385>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-09-03.21:41:37.386>
    closer = 'iritkatriel'
    components = []
    creation = <Date 2021-09-01.11:45:44.455>
    creator = 'iritkatriel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45075
    keywords = ['patch']
    message_count = 8.0
    messages = ['400825', '400827', '400841', '400842', '400849', '400861', '400862', '401018']
    nosy_count = 2.0
    nosy_names = ['chris.jerdonek', 'iritkatriel']
    pr_nums = ['28112']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45075'
    versions = []

    @iritkatriel
    Copy link
    Member Author

    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.

    @iritkatriel
    Copy link
    Member Author

    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.

    @cjerdonek
    Copy link
    Member

    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.

    @iritkatriel
    Copy link
    Member Author

    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.

    @cjerdonek
    Copy link
    Member

    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.

    @cjerdonek
    Copy link
    Member

    Or frame_info (more readable), since FrameSummary is proposed to be "Information about a single frame from a traceback."

    @iritkatriel
    Copy link
    Member Author

    Yes, frame_info is good.

    @iritkatriel
    Copy link
    Member Author

    New changeset 0b58e86 by Irit Katriel in branch 'main':
    bpo-45075: distinguish between frame and FrameSummary in traceback mo… (GH-28112)
    0b58e86

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @pablogsal
    Copy link
    Member

    pablogsal commented Aug 13, 2022

    Could you make a PR documenting format_frame_summary in the 3.11 what's new document as well?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants