Title: Tkinter ttk widgets cget() returning _tkinter.Tcl_Obj instead of str · Issue #126008 · python/cpython · GitHub
Open Graph Title: Tkinter ttk widgets cget() returning _tkinter.Tcl_Obj instead of str · Issue #126008 · python/cpython
X Title: Tkinter ttk widgets cget() returning _tkinter.Tcl_Obj instead of str · Issue #126008 · python/cpython
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_nor...
Open Graph 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...
X 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_...
Opengraph URL: https://github.com/python/cpython/issues/126008
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tkinter ttk widgets cget() returning _tkinter.Tcl_Obj instead of str","articleBody":"\r\nThe docstring: `\"\"\"Return the resource value for a KEY given as string.\"\"\"` claims it returns as a string however it returns a `_tkinter.Tcl_Obj`\r\nwhich seems to lack `__eq__`/the ability to compare it to a string so something like this:\r\n\r\n```py\r\nis_normal = radio_button.cget(\"state\") == tk.NORMAL\r\n```\r\n\r\nWill always return false no matter what unless its wrapped in a str()\r\n\r\nI propose either clarifying the docstr or returning as a str() wrapped obj but i presume that's a breaking change\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-126102\n* gh-133303\n* gh-137660\n* gh-137661\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/maj113","@type":"Person","name":"maj113"},"datePublished":"2024-10-26T15:18:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/126008/cpython/issues/126008"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5944ed1c-a9fd-b8f6-5856-1d7ab975afdf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A0CC:1DECF9:272C5BD:334C06E:696B621D |
| html-safe-nonce | d7346cfa9227e45b7becfc38fdb002b0d77745268bb3cbae230eac6cafb175dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMENDOjFERUNGOToyNzJDNUJEOjMzNEMwNkU6Njk2QjYyMUQiLCJ2aXNpdG9yX2lkIjoiODUwMTM3MDI5MzY1NTkyMTE4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 098c63d05e0a9d1cb09b156a0b2f78571ecaa4668fa7d6f4f6e7a1b8a12b0029 |
| hovercard-subject-tag | issue:2615932126 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/126008/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d5f2db53a51576989a6c8162c9f7ee44a1ad089d27b72551bcf4e0fbf81d5df1/python/cpython/issues/126008 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d5f2db53a51576989a6c8162c9f7ee44a1ad089d27b72551bcf4e0fbf81d5df1/python/cpython/issues/126008 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maj113 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width