[Python-Dev] Okay to document the "exec tuple" form of the exec statement in Python 2.7?

Mark Dickinson dickinsm at gmail.com
Mon Nov 5 13:08:47 CET 2012


In Python 2, the 'exec' statement supports 'exec'-ing a (statement,
globals, locals) tuple:

>>> exec("print 2", {}, {})
2

This isn't currently documented at:
http://docs.python.org/reference/simple_stmts.html#the-exec-statement.
 It's easy to fix the docs, but in doing so we'd effectively be
blessing this form of exec as an official part of the language.  Do
people think it's acceptable to add this to the docs, or are there
good reasons for the 'exec tuple' form of the exec statement to remain
an undocumented feature?

See also http://bugs.python.org/issue16339.

Mark


More information about the Python-Dev mailing list