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

Add a new bytecode instruction to create generators #90567

Closed
markshannon opened this issue Jan 17, 2022 · 2 comments
Closed

Add a new bytecode instruction to create generators #90567

markshannon opened this issue Jan 17, 2022 · 2 comments
Assignees
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@markshannon
Copy link
Member

BPO 46409
Nosy @markshannon, @sobolevn
PRs
  • bpo-46409: Make generators in bytecode #30633
  • bpo-46470: remove unused branch from typing._remove_dups_flatten #30780
  • 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 = 'https://github.com/markshannon'
    closed_at = <Date 2022-01-20.11:49:42.702>
    created_at = <Date 2022-01-17.11:54:35.954>
    labels = ['interpreter-core', 'type-bug', '3.11']
    title = 'Add a new bytecode instruction to create generators'
    updated_at = <Date 2022-01-22.20:19:21.483>
    user = 'https://github.com/markshannon'

    bugs.python.org fields:

    activity = <Date 2022-01-22.20:19:21.483>
    actor = 'sobolevn'
    assignee = 'Mark.Shannon'
    closed = True
    closed_date = <Date 2022-01-20.11:49:42.702>
    closer = 'Mark.Shannon'
    components = ['Interpreter Core']
    creation = <Date 2022-01-17.11:54:35.954>
    creator = 'Mark.Shannon'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46409
    keywords = ['patch']
    message_count = 2.0
    messages = ['410764', '411018']
    nosy_count = 2.0
    nosy_names = ['Mark.Shannon', 'sobolevn']
    pr_nums = ['30633', '30780']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46409'
    versions = ['Python 3.11']

    @markshannon
    Copy link
    Member Author

    (including coroutines, and async generators)

    We now make the start and resumption of Python functions explicit in the bytecode which allows us to initialize frames in the bytecode without exposing incomplete frames tracing, the GC etc.
    However, we still expose incomplete frames when creating generators.

    By making the creation of generators explicit in the bytecode we first create the frame, then the generator and all is well.

    See https://bugs.python.org/issue46374 and https://bugs.python.org/issue46389 for examples.

    @markshannon markshannon added the 3.11 only security fixes label Jan 17, 2022
    @markshannon markshannon self-assigned this Jan 17, 2022
    @markshannon markshannon added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error 3.11 only security fixes labels Jan 17, 2022
    @markshannon markshannon self-assigned this Jan 17, 2022
    @markshannon markshannon added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Jan 17, 2022
    @markshannon
    Copy link
    Member Author

    New changeset b04dfbb by Mark Shannon in branch 'main':
    bpo-46409: Make generators in bytecode (GH-30633)
    b04dfbb

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant