[Zope-dev] urgent: string exceptions

Lennart Regebro lennart@regebro.nu
Sat, 12 Apr 2003 18:39:45 +0200


Guido van Rossum wrote:
> Depends on how you try it.  If in one function you have
> 
>     raise "Bad Request"
> 
> and in another you have
> 
>     try:
>         ...
>     except "Bad Request":
>         ...
> 
> it will fail.  OTOH if you have this in the same function, it will
> succeed, because the bytecode compiler collapses identical constants
> within one function even if they are not interned.

Ah. Thanks for the explanation.