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/2005-April/053078.html below:

[Python-Dev] Re: anonymous blocks

[Python-Dev] Re: anonymous blocksBrett C. bac at OCF.Berkeley.EDU
Thu Apr 28 02:18:19 CEST 2005
Guido van Rossum wrote:
> [Guido]
> 
>>>An alternative that solves this would be to give __next__() a second
>>>argument, which is a bool that should be true when the first argument
>>>is an exception that should be raised. What do people think?
>>>
>>>I'll add this to the PEP as an alternative for now.
> 
> 
> [Nick]
> 
>>An optional third argument (raise=False) seems a lot friendlier (and more
>>flexible) than a typecheck.
> 
> 
> I think I agree, especially since Phillip's alternative (a different
> method) is even worse IMO.
> 

The extra argument works for me as well.

> 
>>Yet another alternative would be for the default behaviour to be to raise
>>Exceptions, and continue with anything else, and have the third argument be
>>"raise_exc=True" and set it to False to pass an exception in without raising it.
> 
> 
> You've lost me there. If you care about this, can you write it up in
> more detail (with code samples or whatever)? Or we can agree on a 2nd
> arg to __next__() (and a 3rd one to next()).
> 

Channeling Nick, I think he is saying that the raising argument should be made
True by default and be named 'raise_exc'.

-Brett
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