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

A SyntaxError less detailed since 3.10 in specific example #94192

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

Description

@Serpens66

Python 3.10.5

New SyntaxError ^ pointer is misleading in following example compared to older python versions.

d = {    "foo":"foo",    "bar":lambda b:{"bar":testfn(von="1"b=b)},     }

Results in error message on 3.10.5:

File "test.py", line 3  "bar":lambda b:{"bar":testfn(von="1"b=b)},       ^SyntaxError: expression expected after dictionary key and ':'

While on python 3.8 it was more helpful:

File "test.py", line 3  "bar":lambda b:{"bar":testfn(von="1"b=b)},                                      ^SyntaxError: invalid syntax

edit: added triple backquotes to preserve formatting on github. thanks hauntsaninja.
On 3.10.5 it is pointing on the ":" prior to lambda, while on 3.8 it is pointing on the missing comma.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp