Alexandre Vassalotti wrote: > On Tue, Mar 31, 2009 at 11:25 PM, Guido van Rossum <[email protected]> wrote: >> Well hold on for a minute, I remember we used to have an exec >> statement in a class body in the standard library, to define some file >> methods in socket.py IIRC. > > FYI, collections.namedtuple is also implemented using exec.
Ah, but it uses "exec ... in ...". That is much safer than an unqualified exec (where the issue is what namespace it executes in, and, consequentially, what early binding is possible). The patch bans only unqualified exec, IIUC. Regards, Martin _______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
