Skip to content

Bytecode for empty f-string != bytecode for empty normal string #99606

Description

Bug report

The bytecode for an empty f-string does not match the bytecode for an empty normal string.

import dis
dis.dis('""')
dis.dis('f""')

Output:

0           0 RESUME                   0

1           2 LOAD_CONST               0 ('')
            4 RETURN_VALUE
0           0 RESUME                   0

1           2 BUILD_STRING             0
            4 RETURN_VALUE

Environment

  • CPython versions tested on:
    3.11, 3.12.0a2

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions