while (a=b()) ...

Barry A. Warsaw bwarsaw at cnri.reston.va.us
Mon May 17 11:06:48 EDT 1999


>>>>> "HN" == Hrvoje Niksic <hniksic at srce.hr> writes:

    HN> I wonder how expensive it is to trap and raise exceptions in
    HN> Python

If the class-based exception is both raised and caught in C, it is
never instantiated, so it's very fast.  If the exception is raised or
caught (or both) in Python, then you pay for instantiation.

-Barry




More information about the Python-list mailing list