|
From: <bc...@wo...> - 2001-04-13 17:06:54
|
[Robert W. Bill] >Hi all, > >I recently ran into another subtle differenct between CPython and >Jython that I was curious about. It concerns the "raise" >statement, and it's behavior when the first expression is an >instance object. > >2.1a1 documentation says, "If the first expression is an instance object, >the second expression must be None." > >In CPython example we see: > >>>> import exceptions >>>> excpt = exceptions.TypeError() >>>> raise excpt, "Something not None" >Traceback (most recent call last): > File "<stdin>", line 1, in ? >TypeError: instance exception may not have a separate value > > >Currently in Jython we see: > >>>> import exceptions >>>> excpt = exceptions.TypeError() >>>> raise excpt, "Something not None" >Traceback (innermost last): > File "<console>", line 1, in ? >: Something not None > > >I was thinking that raising the TypeError is worthwile here. What >do others think? I agree. >If this is a good idea, here's unified diff (cvs diff below- >which one is preferred anyway?) I personnaly prefer unified (-u) diffs. Context (-c) diff are also fine. A bare diff is mostly useless. Watch your mailer's linelength when including patches inside the mail. >====================================================== > >--- .\Py.java Sat Apr 7 16:17:42 2001 >+++ c:\windows\desktop\Py.java Sat Apr 7 16:10:44 2001 Applied. Thanks. regards, finn |