◐ Shell
clean mode source ↗

Tkinter ttk widgets cget() returning _tkinter.Tcl_Obj instead of str

Skip to content

Navigation Menu

Sign in

Appearance settings

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

Closed

@maj113

Description

The docstring: """Return the resource value for a KEY given as string.""" claims it returns as a string however it returns a _tkinter.Tcl_Obj
which seems to lack __eq__/the ability to compare it to a string so something like this:

is_normal = radio_button.cget("state") == tk.NORMAL

Will always return false no matter what unless its wrapped in a str()

I propose either clarifying the docstr or returning as a str() wrapped obj but i presume that's a breaking change

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions