From: <bc...@wo...> - 2001-03-29 18:42:32
|
I forgot about the raise statement. Here there are a difference between CPython and Jython. In Cpython, the first argument (the type) can be tuple and CPython will then unpack the first value of the tuple as the type and it will unpack like this repeatedly. Python 2.1b2 (#12, Mar 23 2001, 14:01:30) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> raise (((IndexError, 45), 1), 3), 56 Traceback (most recent call last): File "<stdin>", line 1, in ? IndexError: 56 >>> This tuple unpacking isn't done by Jython where the entire first expression is used as the exception type: Jython 2.1a1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> raise (((IndexError, 45), 1), 3), 56 Traceback (innermost last): File "<console>", line 1, in ? (((<class exceptions.IndexError at 5352464>, 45), 1), 3): 56 >>> This is a real difference between the python implementations, but there is AFAICT no ambiguity. The raise statement expect 0, 1, 2 or 3 expressions and the expressions can *not* be replaced by a 0, 1, 2 or 3-tuple. regards, finn |