+1. This probably fell through the cracks because I changed my mind on this. The function form was old, and I wanted to root it out in favor fo the statement. But then I changed my mind for py3k. Good idea to document and add tests in 2.x.<div>
<br></div><div>--Guido<span></span><br><br>On Monday, November 5, 2012, Nick Coghlan  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Nov 5, 2012 at 10:08 PM, Mark Dickinson <<a href="javascript:;" onclick="_e(event, 'cvml', 'dickinsm@gmail.com')">dickinsm@gmail.com</a>> wrote:<br>

> In Python 2, the 'exec' statement supports 'exec'-ing a (statement,<br>
> globals, locals) tuple:<br>
><br>
>>>> exec("print 2", {}, {})<br>
> 2<br>
><br>
> This isn't currently documented at:<br>
> <a href="http://docs.python.org/reference/simple_stmts.html#the-exec-statement" target="_blank">http://docs.python.org/reference/simple_stmts.html#the-exec-statement</a>.<br>
>  It's easy to fix the docs, but in doing so we'd effectively be<br>
> blessing this form of exec as an official part of the language.  Do<br>
> people think it's acceptable to add this to the docs, or are there<br>
> good reasons for the 'exec tuple' form of the exec statement to remain<br>
> an undocumented feature?<br>
><br>
> See also <a href="http://bugs.python.org/issue16339" target="_blank">http://bugs.python.org/issue16339</a>.<br>
<br>
If you can find an existing test for it, then definitely (although the<br>
fact it didn't previously work on Jython suggests there may not be<br>
one).<br>
<br>
If there's no test, then I'd still be in favour of making it official<br>
both by testing *and* documenting it, for the forward compatibility<br>
benefits you mention on the tracker.<br>
<br>
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan   |   <a href="javascript:;" onclick="_e(event, 'cvml', 'ncoghlan@gmail.com')">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Python-Dev@python.org')">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">http://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</blockquote></div><br><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)<br>