[Zope-dev] BUG: ValueError while changing height of the template edit window

Guido van Rossum guido@python.org
Wed, 11 Dec 2002 10:00:58 -0500


> I think this would be a useful note for the Zope3 style guide.
> 
> 
> What exceptions can int() raise?
> 
> On converting a preexisting value to an int:
> 
>    ValueError, OverflowError, TypeError, AttributeError
> 
>    (Any others?)
> 
> On converting an instance that implements __int__:
> 
>    Anything at all.
>    It can even return a non-int value.
> 
> On evaluating the expression inside the int() brackets:
> 
>    Anything at all.

Anything can raise MemoryError.

On converting an 8bit string to an int:

     ValueError *only*

On converting a Unicode string to an int:

     ValueError
     UnicodeError (or UnicodeEncodeError, which is a subclass of it)

--Guido van Rossum (home page: http://www.python.org/~guido/)