Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Parts of strings that look like comments being stripped out of nested strings with debug specifier #135148

Closed
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@tom-pytel

Description

@tom-pytel

Bug report

Bug description:

Is this desired behavior?

$ ./python -m astf'{""" # this is part of the string, it shouldn't be stripped out"""=}'Module(   body=[      Expr(         value=JoinedStr(            values=[               Constant(value='""" \n"""='),               FormattedValue(                  value=Constant(value=" # this is part of the string, it shouldn't be stripped out\n"),                  conversion=114)]))])$ ./python -m astt'{""" # this is part of the string, it shouldn't be stripped out"""=}'Module(   body=[      Expr(         value=TemplateStr(            values=[               Constant(value='""" \n"""='),               Interpolation(                  value=Constant(value=" # this is part of the string, it shouldn't be stripped out\n"),                  str='""" \n"""',                  conversion=114)]))])

Even if they are not actually multiline:

$ python -m astt'{" # nooo "=}'Module(   body=[      Expr(         value=TemplateStr(            values=[               Constant(value='" '),               Interpolation(                  value=Constant(value=' # nooo '),                  str='"',                  conversion=114)]))])

Seems to go back to 3.12

CPython versions tested on:

3.14, CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp