GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SyntaxError location for `*args` in class bases is inconsistent · Issue #93165 · python/cpython

SyntaxError location for *args in class bases is inconsistent #93165

New issue
Copy link
New issue
Copy link
Closed
Closed
SyntaxError location for *args in class bases is inconsistent#93165
Copy link
Labels
3.10 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@tusharsadhwani
tusharsadhwani
opened on May 24, 2022
Issue body actions

Code snippet:

class C(list[int]): ...

On Python 3.9:

>>> class C(list[*a]): ...
  File "<stdin>", line 1
    class C(list[*a]): ...
                   ^
SyntaxError: invalid syntax
>>> 

On Python 3.10:

>>> class C(list[*a]): ...
  File "<stdin>", line 1
    class C(list[*a]): ...
           ^
SyntaxError: expected ':'
>>>

I'd have expected it to point directly at the * in both cases.

Activity

  1. tusharsadhwani
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 24, 2022
  2. AlexWaygood
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    3.10 (EOL)end of lifeend of life
    on May 24, 2022
  3. AlexWaygood commented on May 24, 2022

    @AlexWaygood
    AlexWaygood
    on May 24, 2022
    Member
    More actions

    Reproduced on 3.9/3.10 (but not on 3.11, where this isn't a SyntaxError at all due to PEP 646).

    Cc. @pablogsal

  4. wookie184 commented on May 26, 2022

    @wookie184
    wookie184
    on May 26, 2022
    Contributor
    More actions

    I believe this is a specific case of #92858, which is fixed by #92894

  5. tusharsadhwani commented on May 29, 2022

    @tusharsadhwani
    tusharsadhwani
    on May 29, 2022
    ContributorAuthor
    More actions

    Correct, closing.

  6. tusharsadhwani
    closed this as completedon May 29, 2022
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

    3.10 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.