Home

On Mon, 2007-09-24 at 19:48 +0800, Delaney, Timothy (Tim) wrote:
> Always be careful with int() incase any of the values have a leading
> zero - check the documentation for int() carefully.

Why would leading zeroes be a problem?

>>> int("10")
10
>>> int("010")
10
>>> int("0010")
10
>>> int("00010")
10

Maybe you're thinking of "evil eval?"

>>> eval("10")
10
>>> eval("010")
8

--
Carsten Haese
http://informixdb.sourceforge.net

previous
next

Re: wxPython version question
Re: Cross-platform time out decorator
Re: Protected declaration
Re: C/C++ guidelines
Re: Array of pointers. How to check index without failure?
Podaruj Zycie
Rodzic Po Ludzku
Niechciane i Zapomniane
Krwinka
Fundacja Iskierka