Skip to content

tkinter.Event is not subscriptable at runtime but generic in stub file #123341

@yowoda

Description

@yowoda

Bug report

Bug description:

import tkinter
tkinter.Event[tkinter.Canvas] # TypeError: 'type' object is not subscriptable

This has been briefly discussed at python/typeshed#12591

It would be great if this problem (a little more detailed version here) could be fixed in the entire standard library. As of right now, the inconsistency of class subscription support is just way too confusing for developers.

CPython versions tested on:

3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch

Operating systems tested on:

Linux, Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions