become available for it. I wonder if someone could tell me the best
way to avoid future problems parsing decimal integers with leading
zeros.
9>>int('09')
That works in 2.5 but will break in 2.6 AFAIK as int() is being
changed to use Numeric Literal syntax. It will give a syntax error as
the leading 0 will force an octal radix and the 9 will be out of
range. Will this avoid the breakage?
9>>int('09', 10)
Or should I use this uglier variation that needs 2.2.2 or later?
9>>int('09'.lstrip('0'))
Is the documentation for int([x[, radix]]) correct? I'd say that the
default for radix has become 0.
http://docs.python.org/library/functions.html#int
--
Pete Forman -./\.- Disclaimer: This post is originated
WesternGeco -./\.- by myself and does not represent
pe*********@westerngeco.com -./\.- the opinion of Schlumberger or
http://petef.22web.net -./\.- WesternGeco.