> 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/)

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to