[Python-Dev] Okay to document the "exec tuple" form of the exec statement in Python 2.7?
Michael Bayer
mike_mp at zzzcomputing.com
Mon Nov 12 23:15:07 CET 2012
On Nov 5, 2012, at 4:51 PM, Greg Ewing wrote:
> Nick Coghlan wrote:
>> On Mon, Nov 5, 2012 at 10:08 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
>>> In Python 2, the 'exec' statement supports 'exec'-ing a (statement,
>>> globals, locals) tuple:
>
> If this is a deliberate feature, I'd guess it's because exec
> is a statement rather than a function in Python 2, so you
> can't use * to pass a tuple of arguments to it.
any chance, if this function is documented, someone can make it very clear what the cross-compatibility implications are with the Python 2.x form of exec() and the Python 3.x form ? I'm having a hard time demonstrating the difference to myself, though the winning answer to his StackOverflow question http://stackoverflow.com/questions/6561482/why-did-python-3-changes-to-exec-break-this-code seems to suggest the behavior of symbol tables has changed.
>
> --
> Greg
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/mike_mp%40zzzcomputing.com
>
More information about the Python-Dev
mailing list