[Python-Dev] Shortcut bugfix

M.-A. Lemburg mal@lemburg.com
Tue, 18 Mar 2003 10:50:29 +0100


Raymond Hettinger wrote:
> The shortcut is to fix something that isn't broken and have string.atoi
> stop automatically appending the ten to the int() call.
> 
> Current string.atoi:
>     def atoi(s, base=10):
>         return _int(s, base)
> 
> Proposed string.atoi:
>     def atoi(s, *args):
>         return _int(s, *args)
> 
> The shortcut has some appeal because it lets the improvements
> to _tkinter stay in place and allows existing Pmw installations
> to continue to operate.  Otherwise, one of the two has to change.
> 
> Does anyone think changin string.atoi is the wrong way to go?

Yes, because it changes the semantics. string.atoi() would suddenly
start to accept non-strings like integers, floats, etc.

My suggestion would be to carefully reconsider the changes to
_tkinter. If it's true that a method can now return strings *and*
integers which previously only returned strings, then such a
change is clearly not backward compatible.  I'd create a new
method for the new semantics in that case.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Mar 18 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
Python UK 2003, Oxford:                                     14 days left
EuroPython 2003, Charleroi, Belgium:                        98 days left