Author serhiy.storchaka
Recipients serhiy.storchaka, terry.reedy
Date 2015-04-07.18:57:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428433060.72.0.27114219099.issue23880@psf.upfronthosting.co.za>
In-reply-to
Content
> 0.  It seems that this pushes conversions from python code (app.py, tkinter.py) to C (_tkinter.py).  Correct?  What is being gained from a user viewpoint?

The benefit is that widget.tk.getint(widget.tk.call(...)) (and widget.getint(widget.call(...))) always works when it makes sense. Currently it works for integers and strings. If the result of Tcl call becomes some specific type in new Tcl version, this needs a workaround with converting to str, as you can see in IDLE code. User code with this patch will become more robust against future Tcl/Tk changes. And actually against changes that already happen in recent Tcl versions. Many user code that worked with 8.3 or 8.4 needed an update to work with 8.5 or 8.6. With this patch they perhaps need less changes.

> 2. Does the change break existing code?

Usually not.

>  In particular, is the idlelib change necessary or optional?

It is optional. It is is just a demonstration how the code can be made simpler and more robust.

> How does this match getint and getdouble being synonyms for builtins?
> -    getint = int
> -    getdouble = float
> Or were 'int' and 'float' overridden before this?

There are different functions on different levels. There are tkapp methods in _tkinter.c. There are Misc methods in tkinter.py (added in changesets 73dd2a979857 and 273451892327). They originally was wrappers around tkapp methods. There are module-level functions in tkinter.py. They were converted to aliases of int and float in 34cca832a4af.

> 3. Should there be a doc change, at least in docstrings?

Unfortunately all these functions are not documented.
History
Date User Action Args
2015-04-07 18:57:40serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy
2015-04-07 18:57:40serhiy.storchakasetmessageid: <1428433060.72.0.27114219099.issue23880@psf.upfronthosting.co.za>
2015-04-07 18:57:40serhiy.storchakalinkissue23880 messages
2015-04-07 18:57:40serhiy.storchakacreate