Message225494
| 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. |
|