Does eval has the same features as Perl's?

Jm lists practicalperl at gmail.com
Sat Jan 20 10:30:24 CET 2007


Hello members,

I want to know does the "eval" in python have the same features as in
Perl (capture errors)?

For example,in perl I can wrote:

$re = eval { 1 / 0 };

Though 1/0 is a fatal error but since it's in "eval" block so the perl
interpreter doesn't get exit.

Thanks again.



More information about the Python-list mailing list