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 — Bad error message when inheriting from Generic multiple times · Issue #104328 · python/cpython

Bad error message when inheriting from Generic multiple times #104328

New issue
Copy link
New issue
Copy link
Closed
Closed
Bad error message when inheriting from Generic multiple times#104328
Copy link
Labels
topic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@JelleZijlstra
JelleZijlstra
opened on May 9, 2023
Issue body actions
>>> from typing import Generic, TypeVar
>>> T = TypeVar("T")
>>> U = TypeVar("U")
>>> class X(Generic[T], Generic[U]): pass
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jelle/py/cpython/Lib/typing.py", line 1088, in _generic_init_subclass
    raise TypeError(
TypeError: Cannot inherit from Generic[...] multiple types.

Should say "multiple times".

Noticed by @carljm in #103764 (comment).

Linked PRs

  • gh-104328: Fix typo in typing.Generic multiple inheritance error message #104335
  • [3.11] gh-104328: Fix typo in typing.Generic multiple inheritance error message (GH-104335) #104338
Reacted by sunmy2019

Activity

  1. JelleZijlstra
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    topic-typing
    on May 9, 2023
  2. carljm
    added a commit that references this issue on May 9, 2023

    gh-104328: Fix typo in ``typing.Generic`` multiple inheritance error …

    01c321c
  3. miss-islington
    added a commit that references this issue on May 9, 2023

    pythongh-104328: Fix typo in ``typing.Generic`` multiple inheritance …

    528cc01
  4. AlexWaygood
    added a commit that references this issue on May 9, 2023

    [3.11] gh-104328: Fix typo in ``typing.Generic`` multiple inheritance…

    663b321
  5. carljm
    closed this as completedon May 9, 2023
  6. carljm
    added a commit that references this issue on May 10, 2023

    Merge branch 'main' into fixloadsuperspec

    5976df9
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

    topic-typingtype-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.