[Python-Dev] Re: PEP-317

Samuele Pedroni pedronis@bluewin.ch
Mon, 09 Jun 2003 16:35:55 +0200


At 16:27 09.06.2003 +0200, Samuele Pedroni wrote:
>At 09:58 09.06.2003 -0400, Terry Reedy wrote:
>
>>"Raymond Hettinger" <raymond.hettinger@verizon.net> wrote in message
>>news:001f01c32e41$b4b7c440$4827a044@oemcomputer...
>> > I think it would only be fair to add:
>> >
>> >   "If this proposal is adopted, nearly every piece of non-trivial
>>python
>> >    code that has ever been written would need to be revised or would
>> >    fail to run.  Likewise, most tutorial and book examples would
>>also
>> >    fail."
>>
>>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.