Message225446
Currently Tkinter supports two modes:
* When wantobjects=1 (default), all results of Tcl/Tk commands are converted to appropriate Python objects (int, float, str, bytes, tuple) if it is possible or to Tcl_Obj for unknown Tcl types.
* When wantobjects=0 (legacy mode), all results of Tcl/Tk commands are converted to strings.
But arguments of a callback are always converted to str, even when wantobjects=1. This can lost information ("42" is not distinguished from 42 or (42,)) and may be less efficient. Unfortunately we can't just change Tkinter to pass callback arguments as Python objects, this is backward incompatible change. Proposed patch introduces third mode wantobjects=2. It is the same as wantobjects=1, but callbacks now received . Default mode is still wantobjects=1, it can be changed in future. But in Tkinter applications (IDLE, Turtledemo, Pynche) we can use wantobjects=2 right now.
The only problem left is documenting it. The wantobjects parameter is not documented at all except an entry in "What's New in Python 2.3". Does anyone want to document this feature? |
|
Date |
User |
Action |
Args |
2014-08-17 14:24:09 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, gpolo |
2014-08-17 14:24:09 | serhiy.storchaka | set | messageid: <1408285449.26.0.836464630135.issue22214@psf.upfronthosting.co.za> |
2014-08-17 14:24:09 | serhiy.storchaka | link | issue22214 messages |
2014-08-17 14:24:08 | serhiy.storchaka | create | |
|