On Mon, May 2, 2011 at 11:23 AM, Jack Bates <ms...@freezone.co.uk> wrote: > Hi, anyone know why these two statements aren't equivalent? > > raise (type, value, traceback) > > raise type, value, traceback
The latter is the syntax of the raise statement: up to 3 expressions, separated by commas. The former has a single expression that evaluates to a tuple. It's equivalent to this: t = (type, value, traceback) raise t That it accepts the tuple and raises a value-less expression of type `type` surprises me. The docs don't say anything about this, and I would have expected a TypeError, but it appears to be extracting the first element of the tuple and using that as the value of the first expression. -- http://mail.python.org/mailman/listinfo/python-list