[Python-Dev] Shortcut bugfix

Martin v. L÷wis martin@v.loewis.de
18 Mar 2003 07:58:03 +0100

"Raymond Hettinger" <raymond.hettinger@verizon.net> writes:

> There are three parts to the story:
> 1.   a method in _tkinter.c was changed (probably appropriately) to 
>       occassionally return ints in addition to strings.
> 2.   Pmw used string.atoi() to coerce the result to an int.
>       This should probably be changed, but I don't want
>       existing Pmw to suddenly fail under 2.3.

Is Pmw using _tkinter directly, or indirectly via Tkinter?

Neither answer to this question makes sense:
a) if Pmw uses _tkinter directly, it should not receive int results.
b) if Pmw uses Tkinter, it should not find methods that used to
   return strings but now return ints.

If, for some strange reason, b) does happen, applications can invoke
Tkinter.wantobjects = 0
to restore the old behaviour.

> Does anyone think changin string.atoi is the wrong way to go?

It would change the historical behaviour, I believe:
string.atoi(10) used to give a TypeError even back in Python 1.5.