[Q] Are Exceptions used that much in practice?

Andreas Jung andreas at andreas-jung.com
Tue Dec 12 09:45:24 CET 2000


On Tue, Dec 12, 2000 at 01:35:34AM -0600, Jerome Mrozak wrote:
> I realize that Python allows me to catch exceptions.  But being a novice
> I'm not sure if they are used much in the 'real world'.
> 
> In Java, my current bread-winning language, exceptions are caught mostly
> because the compiler/language demands it.  I haven't yet designed a
> system in Java such as:
> 
> while(1):
>   try:
>     read
>   catch:
>     break
>   else:
>     ...

Usually I use try/except to catch critical operations like
network stuff or when calling functions inside other modules.
It depends mostly on the implementation of the functions -
some are using return codes for indicating errors but
others prefer to use exceptions.

Andreas 




More information about the Python-list mailing list