11 Dec
2002
11 Dec
'02
2:52 p.m.
I saw "try: int() except:" pattern in many places through all the Zope code. I think catching ValueError only does the job, but then we should replace it in all the places. :-)
Yes, catching ValueError is sufficient for string conversions to int. I thought you could get an OverflowError, but that can only happen when the input is a Python long or float -- int("999999999999999") raises ValueError, as does int("xxx"). --Guido van Rossum (home page: http://www.python.org/~guido/)