A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-January/115887.html below:

[Python-Dev] PEP for allowing 'raise NewException from None'

[Python-Dev] PEP for allowing 'raise NewException from None' [Python-Dev] PEP for allowing 'raise NewException from None'Ethan Furman ethan at stoneleaf.us
Sat Jan 28 01:33:21 CET 2012
Terry Reedy wrote:
> The PEP does not address the issue of whether the new variation of raise 
> is valid outside of an except block. My memory is that it was not to be 
> and I think it should not be. One advantage of the 'as' form is that it 
> is clear that raising the default as something else is invalid if there 
> is no default.

Were you speaking of the original (PEP 3134), or this new one (PEP 409)?

Because at this point it is possible to do:

     raise ValueError from NameError

outside a try block.  I don't see it as incredibly useful, but I don't 
know that it's worth making it illegal.

So the question is:

   - should 'raise ... from ...' be legal outside a try block?

   - should 'raise ... from None' be legal outside a try block?

~Ethan~
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4