[Python-Dev] Python in Unicode context

Michael Hudson mwh at python.net
Thu Aug 5 13:18:18 CEST 2004


"M.-A. Lemburg" <mal at egenix.com> writes:

> To me ...
>
> try:
>      ...
> except Exception, errobj:
>      # catches all exceptions
>      pass
>
> ... is the most natural way of using that single root (and it already
> works great today).

Well, uh, it's not totally bullet proof:

>>> class C: pass
... 
[24618 refs]
>>> try: raise C
... except Exception, err: print err
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
__main__.C: <__main__.C instance at 0x403a7814>
[24654 refs]
>>> 

but I this really doesn't seem to happen in the wild.

(I have a hacky patch which makes exceptions new-style which I'll post
in a moment).

Cheers,
mwh

-- 
  Lisp nearing the age of 50 is the most modern language out
  there. GC, dynamic, reflective, the best OO model extant including
  GFs, procedural macros, and the only thing old-fashioned about it 
  is that it is compiled and fast.   -- Kenny Tilton, comp.lang.python


More information about the Python-Dev mailing list