Message313943
> If the issue really boils down to incorrectly passing a single string when there is only one item in 'values', and a single-item tuple should be used instead, then shouldn't the better solution be for Python to handle this automatically and re-cast the errant string into a tuple?
Tkinter is rather a thin wrapper around Tcl/Tk. I just passes values to Tcl. Tcl is a weak typed language. Internally it can use different types for performance, but semantically all are strings. "a b" is a string and a 2-element list, and a 1-element dict at the same time. It is Tcl try to re-cast the errant string into a Tcl list, and fails because it has incorrect syntax. Python can't know your intention. It supposes that you know what you do. If under re-casting you meant passing a string to a tuple constructor, `tuple(values)`, this will be obviously wrong. If your meant parsing a string to a tuple at Python side -- it will file as well as parsing it at Tcl side. If you meant wrapping a string into a one-element tuple, `(values,)`, this can break working code when a user intentionally passes a space separated list of words:
tv.insert("", END, values=(foo, bar), tags="foo bar")
Additionally, any special cases will complicate the code of Tkinter (currently it is rather a thin wrapper) and complicate the mental model. |
|
| Date |
User |
Action |
Args |
| 2018-03-16 09:24:26 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, kumba |
| 2018-03-16 09:24:26 | serhiy.storchaka | set | messageid: <1521192266.17.0.467229070634.issue32328@psf.upfronthosting.co.za> |
| 2018-03-16 09:24:26 | serhiy.storchaka | link | issue32328 messages |
| 2018-03-16 09:24:26 | serhiy.storchaka | create | |
|