Dan wrote: > While perusing sre.py in the standard library, I came upon this snippet > of code in the _compile() function definition: > > try: > p = sre_compile.compile(pattern, flags) > except error, v: > raise error, v # invalid expression > > Is there some particular use in catching an exception and immediately > re-raising it? Why catch it at all? > > /Dan >
All I can think of is that it changes the traceback to point to the re-raise and not the original raise. -Kirk McDonald -- http://mail.python.org/mailman/listinfo/python-list