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

misleading SyntaxError (f-string and type alias related) #109114

Closed
Labels
type-bugAn unexpected behavior, bug, or error
@15r10nk

Description

@15r10nk

Bug report

Bug description:

The following code produces a misleading syntax error.

lambdaname_3=f'{name_4}': {name_3}type {}[name_4]= {}

output (Python 3.12.0rc2+):

File"/home/frank/projects/pysource-codegen/bug.py",line1lambdaname_3=f'{name_4}': {name_3}^^^^^^^^^^^^^^^^^^^^^^^^^^SyntaxError:f-string:lambdaexpressionsarenotallowedwithoutparentheses

The first line should be valid python syntax and I would expect to get an syntax error for the wrong type alias name.

side note:
This is generated code. I found this issue during my work for the python 3.12 support for pysource-codegen.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp