Anything can raise MemoryError.
Ok. But I don't think regular application code should catch these.

On converting an 8bit string to an int:

     ValueError *only*

On converting a Unicode string to an int:

     UnicodeError (or UnicodeEncodeError, which is a subclass of it)
Can you provide an example of raising a unicode error like this:

u = makeUnicodeString() # your choice of function

My point is that once you have a valid unicode object, I don't see how calling int(valid_unicode_object) will raise a UnicodeError.

If this is so, then the style should be:

value = expression_to_compute_value
i = int(value)
except ValueError:
# take corrective action

rather than:

i = int(expression_to_compute_value)
except: # Note: calling 'int()' can raise just about anything
# take corrective action

Steve Alexander

Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - )

Reply via email to