This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients gpolo, serhiy.storchaka, terry.reedy
Date 2014-08-18.14:52:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1773805.Ac0eld9Jjd@raxxla>
In-reply-to <1408328750.43.0.981918583347.issue22214@psf.upfronthosting.co.za>
Content
> The patch appears to change it to 2 in tkinter/__init__.py.

This is for development only. You can apply the patch and test how new mode 
affects IDLE or other applications.

> One thing slightly puzzles me: the current PythonCmd is used in a call to
> Tcl_CreateCommand.  (Since the latter is not in _tkinter, I presume it is
> 'imported' in one of the includes.)  The new PythonObjCmd is passed to
> Tcl_CreateObjCommand. Does that already exist, just waiting for us to add
> PythonObjCmd?

All Tcl_* functions are Tcl C API functions. Old functions work with strings 
(char *). Modern functions (have "Obj" in a name) work with specialized Tcl 
objects (Tcl_Obj *).

> I near as I can tell, the only differences between PythonCmd and
> PythonOjbCmd are /argv/objv/ and the following.
> 
>       PyObject *s = unicodeFromTclString(argv[i + 1]);
>       PyObject *s = FromObj(data->self, objv[i + 1]);
> 
> I think I would make the name substitution either in both or neither.  It
> would be nice to reuse the rest of the code.

I'm not sure that I understand all you mean, but in updated patch the common 
code are extracted to separate function.
Files
File name Uploaded
tkinter_obj_cmd_2.patch serhiy.storchaka, 2014-08-18.14:52:45
History
Date User Action Args
2014-08-18 14:52:45serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, gpolo
2014-08-18 14:52:45serhiy.storchakalinkissue22214 messages
2014-08-18 14:52:45serhiy.storchakacreate