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

invalid_def_raw and invalid_class_def_raw rules do not account for type parameters #110938

Closed
Assignees
pablogsal
Labels
@MatthieuDartiailh

Description

@MatthieuDartiailh

Bug report

Bug description:

The rules which are affected are here:

invalid_def_raw:

Typically I believe they should read

invalid_def_raw:    | ['async'] a='def' NAME [type_params] '(' [params] ')' ['->' expression] ':' NEWLINE !INDENT {        RAISE_INDENTATION_ERROR("expected an indented block after function definition on line %d", a->lineno) }invalid_class_def_raw:    | 'class' NAME [type_params] ['(' [arguments] ')'] NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }    | a='class' NAME [type_params] ['(' [arguments] ')'] ':' NEWLINE !INDENT {        RAISE_INDENTATION_ERROR("expected an indented block after class definition on line %d", a->lineno) }

to allow proper error reporting if the definition uses type parameters.

CPython versions tested on:

3.12

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp