string.atoi('-')

John W. Baxter jwbaxter at olympus.net
Fri Apr 30 01:21:19 EDT 1999


In article <372904D7.1A9FC1AB at bioreason.com>, Andrew Dalke
<dalke at bioreason.com> wrote:

> (cc'ed to Jens Linge <linge at embl-heidelberg.de>, the author of)
> > With python 1.51 running on a SGI:
> > >>> string.atoi('-')
> > Traceback (innermost last):
> >   File "<stdin>", line 1, in ?
> > ValueError: invalid literal for atoi(): -
> > >>> 
> > 
> > But with python 1.52 running on a SGI:
> > >>> string.atoi('-')
> > 0
> > >>> 
> > 
> > Does it depend on the compilation?
> > Does anyone have the same problem?
> > 
> > WHAT IS THE RULE?

The rule is:  for the sake of sanity, do not present atoi() with the string '-'.

   --John

-- 
If nothing is pressing, putter about with this or that.
    (Fortune cookie)
John W. Baxter   Port Ludlow, WA USA  jwb at olympus.net




More information about the Python-list mailing list