[Python-Dev] Re: PEP-317

Neal Norwitz neal@metaslash.com
Mon, 09 Jun 2003 10:51:31 -0400


On Mon, Jun 09, 2003 at 04:35:55PM +0200, Samuele Pedroni wrote:
> At 16:27 09.06.2003 +0200, Samuele Pedroni wrote:
> >At 09:58 09.06.2003 -0400, Terry Reedy wrote:
> >
> >>A conversion utility that converted 'raise item' to 'raise item()' and
> >>'raise item,arg' to 'raise item(arg)' would definitely be helpful.  A
> >>working version, or at least a promise to produce one on acceptance
> >>might make the PEP more palatable.
> >
> >given that in:
> >
> >raise X
> >raise X,y
> >raise X(...)
> >
> >(likely) in most cases X is a builtin/global constant/or comes straight 
> >from an import, such a static analysis tool should be doable, for the rest 
> >the user could be informed about non-straightforward cases like:
> >
> >def raise_(X,y):
> >  raise X,y
> 
> 
> the point: such a tool could also statically detect string exceptions 
> usage, I think PyChecker already is able of that. 

Yes, it does.  PyChecker could be modified to check for 'raise item'
vs. 'raise item()' too.  

I'm all for removing string exceptions, but -1 on the PEP.  I don't
see the benefit.  It seems to require more keystrokes for at best 
a very small conceptual benefit.

BTW, this may be more parallel to Java, but not C++.  How about Ruby?
Just curious...

Neal