[Python-Dev] Python in Unicode context

M.-A. Lemburg mal at egenix.com
Thu Aug 5 13:48:23 CEST 2004


Michael Hudson wrote:
> "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:

I meant that it works for the vast majority of all cases
you see in practice. I haven't seen a non-Exception based
exception in years.

>>>>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
> 

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 05 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list