Feature suggestion -- return if true

Colin J. Williams cjw at ncf.ca
Tue Apr 12 16:01:45 CEST 2011


On 12-Apr-11 06:55 AM, scattered wrote:
> On Apr 12, 2:21 am, James Mills<prolo... at shortcircuit.net.au>  wrote:
>> On Tue, Apr 12, 2011 at 4:08 PM, Nobody<nob... at nowhere.com>  wrote:
>>> It should be abundantly clear that this only returns if the expression is
>>> considered true, otherwise it continues on to the following statements.
>>
>> Uggh come on guys. We've been over this.
>> You cannot make that assumption.
>>
>> cheers
>> James
>>
>> --
>> -- James Mills
>> --
>> -- "Problems are solved by method"
>
> I'm puzzled as to why you seem to be parsing the OP's statements
> different from everybody else. The only assumption that people other
> than you seem to be making is that they are assuming that the OP meant
> what he said. He *gave* a definition of what he meant by return? and
> the definition he actually gave has the property that it terminates
> the function only when the condition is true, whereas your suggested
> translation *always* terminates the function call. I agree with
> "Nobody" that the OP's intention was "abundantly clear". Your "return
> expr or None" suggestion was not an unreasonable try - but it doesn't
> provide something which is equivalent to what the OP gave. On the
> other hand, your persistence in defending your original statement as a
> plausible translation of return? after the difference has been pointed
> out by various posters *is* starting to become unreasonable.

In my view, the suggestion would add complexity to the language without 
sufficient benefit.

Colin W.






More information about the Python-list mailing list