[Zope-Coders] RFC: Death to string exceptions

Fred L. Drake, Jr. fred at zope.com
Mon Nov 17 15:13:52 EST 2003


Tres Seaver writes:
 > The middle one was *never* catchable at all (exceptions are caught
 > by identity, not equality;

If the string was raised and caught in the same function, it would
have worked though.  ;-)  The bytecode compiler would have shared the
two copies of the string.  In all other cases (the interesting ones),
that wouldn't happen.

 > Python interns "short" string literals as long as they don't have
 > white space).

The specific rule is that string literals have to look like Python
identifiers to be interned.


  -Fred

-- 
Fred L. Drake, Jr.  <fred at zope.com>
PythonLabs at Zope Corporation



More information about the Zope-Coders mailing list