From: D-Man <ds...@ri...> - 2001-05-21 15:10:15
|
On Mon, May 21, 2001 at 02:09:41PM +0200, Jerome Bouat wrote: | > I attempt to make the string.atol('564645646465465L') | > conversion but I obtained this error trace with JPython 2.0 : | > | > merveilles{27} jpython1.1 | > JPython 1.1 on java1.2.2 (JIT: sunwjit) | | Sorry, error trace with JPython 1.1 of course. | | Does this 'atol' problem has been fixed with JPython 2.0 ? Actually, IIRC, string.atol and string.atoi are deprecated. Instead use the builtin functions "long" and "int", respectively. (unfortunately Jython doesn't have doc strings in all of the standard stuff) Python 2.1 (#1, Apr 17 2001, 09:45:01) [GCC 2.95.3-2 (cygwin special)] on cygwin_nt-4.01 Type "copyright", "credits" or "license" for more information. >>> print long.__doc__ long(x) -> long integer long(x, base) -> long integer Convert a string or number to a long integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the given base. It is an error to supply a base when converting a non-string. >>> print int.__doc__ int(x[, base]) -> integer Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. >>> Jython 2.0 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> print long.__doc__ None >>> print int.__doc__ None >>> long( "564645646465465L" ) 564645646465465L >>> -D |