Message197881
Currently the repr() for Tcl_Obj is not very useful. It exposes only Tcl type name and Tcl object address.
>>> import tkinter.ttk
>>> tv = tkinter.ttk.Treeview()
>>> tv.tag_configure('test', foreground='blue')
{}
>>> str(tv.tag_configure('test', 'foreground'))
'blue'
>>> tv.tag_configure('test', 'foreground')
<color object at 0xb70f84b8>
You need explicitly call str to get more useful information. This is awkward when Tcl object hidden deeply in tuples or other data structure, or reported in a backtrace. Actually every Tcl object can be represented as a string. I propose to expose this representation in repr(). With proposed patch the output of the last command will be: <color object: 'blue'>. |
|
Date |
User |
Action |
Args |
2013-09-16 08:47:32 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, gpolo |
2013-09-16 08:47:32 | serhiy.storchaka | set | messageid: <1379321252.25.0.835083719717.issue19034@psf.upfronthosting.co.za> |
2013-09-16 08:47:32 | serhiy.storchaka | link | issue19034 messages |
2013-09-16 08:47:31 | serhiy.storchaka | create | |
|