<div dir="ltr">Raum, please make sure you reply on-list. I cannot see your replies here.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 25, 2012 at 10:09 PM, alex23 <span dir="ltr"><<a href="mailto:wuwei23@gmail.com" target="_blank">wuwei23@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 26 Dec, 10:44, Ram Rachum <<a href="mailto:r...@rachum.com">r...@rachum.com</a>> wrote:<br>
> I don't think that this makes Python less clear;<br>
<br>
How can you possibly say this?<br>
<br>
You've changed the `finally` clause from _guaranteed_ execution to<br>
something utterly inconsistent. In fact, finally blocks would need to<br>
have _more_ code to guard against all of the different execution<br>
models you're proposing here. I'm not sure why you think forcing me to<br>
write more & less obvious code in a finally block is a better trade<br>
off than you making clear, explicit use of decorators.<br>
<br>
Ambiguity does not equate to clarity. Less typing doesn't either.<br>
Creating small re-usable pieces of code that do the "hard work" for<br>
you, however, _is a lot more clear_.<br>
<br>
> I think it's just another<br>
> minor feature that might be useful for some people, and for people who<br>
> don't, it won't matter. How many people use the `for..else` feature, for<br>
> example? Very, very few people do. I've used it only several times. But<br>
> it's still part of Python because it helps in a few rare cases, so that<br>
> makes it worth it *despite* the fact that it might confuse a newbie.<br>
<br>
The behaviour of `for..else` doesn't change based on arbitrary<br>
conditions, whereas what you propose is that the finally blocks<br>
behaviour is _fundamentally_ different depending on whether the try<br>
block is fully executed or not, whether an exception is raised or not.<br>
This is absolutely not the same thing, and trying to pass this concern<br>
off as "confusing to newbies" is rather disingenuous. The behaviour<br>
would be _confusing to everybody_.<br>
<br>
This is not a valid cost to save you from having to type a few more<br>
keystrokes to decorate the return value.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Jasper<br>
</div>