<div dir="ltr"><br><div class="gmail_extra"><br clear="all"><div>Joćo Bernardo</div>
<br><br><div class="gmail_quote">2013/3/2 Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div class="im">On 3/2/2013 4:04 PM, Joćo Bernardo wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I was thinking about "yield from" and how many times I wanted to use the<br>
feature, but because of backward compatibilities, I couldn't.<br>
</blockquote>
<br></div>
Load 3.3 and use it. If you need an external 3.x library that will not run on 3.3 yet, 6 months after release, bug the author. If you want your code to run on earlier releases, select new and old versions with 'if version....'/<div>

<br></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It's sad that it may take possibly 5 or 10 years to see this statement<br>
being used in real programs...<br>
</blockquote>
<br></div>
But it will not take that long. 'yield from' plays an essential role in Guido's new asynch package (code name: Tulip), which he hope will be ready for 3.4. It will probably also run in 3.3, but that will be it. People who want to use it will have to upgrade.<div class="im">

<br></div></blockquote><div> </div><div>Writing new stuff for the stdlib doesn't need to be compatible with older python versions... I develop on 3.3 but need to support 3.1 or 3.0.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I don't know if this was proposed before, but why can't Python have an<br>
"__experimental__" magic package for this kind of stuff?<br>
</blockquote>
<br></div>
Experimental modules and packages are usually available on PyPI. I think experimental syntax that might be removed is a BAD idea. Getting rid of things that were not experimental is bad enough.<div><br></div></blockquote>

<div> </div><div>If something is experimental, people are advised against using it for production. The idea here is to make forward compatibility possible.<br></div><div> <br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


Note that*the idea is not for people to use experimental features* when<div class="im"><br>
they appear, but to have a fallback for when the feature becomes official!<br>
</div></blockquote>
<br>
The details of a new feature are not fixed until they are fixed, when it becomes official be being added. Even future imports are not backported as bugfix releases do not get new features.<span class=""><font color="#888888"><br>


<br></font></span></blockquote><div><br></div><div>It is not about backporting features. Think about the "with" statement:<br><br></div><div>It was added on version 2.5 (not as default) then it changed on version 2.7 to allow multiple contexts.<br>

</div><div>You can write code compatible with 2.5, 2.6 and 2.7 by just restricting yourself to use only one context per block.<br><br></div><div>Now, if you had a partial version of "yield from" syntax on 3.1 that could solve 50% of the problems of the current syntax, it would be used a lot by now.<br>

</div><div>The current problem is that on older versions, using it gives <b>SyntaxError </b>that cannot be bypassed by a try...except... statement!<br><br></div><div>Having the syntax available makes possible to do:<br><br>

</div><div>    if sys.version_info >= (3,3):<br></div><div>        yield from foo()<br></div><div>    else:<br></div><div>        bar()<br></div></div><br><br></div></div>