Skip to content

tkinter.OptionMenu(command=...) type hint wrong #16111

Description

@petersuttondev

command: Callable[[StringVar], object] | None = ...,

Callable[[StringVar], object] should be Callbable[[str], object]

In the source called here with self.__value

https://github.com/python/cpython/blob/11d0da5b54b1a162e8f2566675007cfb2db797b5/Lib/tkinter/__init__.py#L4584

Called here with value:

https://github.com/python/cpython/blob/c63aec69bd59c55314c06c23f4c22c03de76fe45/Lib/tkinter/__init__.py#L4241

Type of value (and values) is str:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions