This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kristjan.jonsson
Recipients audax, kristjan.jonsson, pitrou, rhettinger
Date 2011-05-12.13:53:22
SpamBayes Score 7.304041e-08
Marked as misclassified No
Message-id <1305208403.82.0.519378159824.issue3974@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, exec is unholy:)

For embedding Python into a console game we have removed the python compiler.  exec and eval don't work.  This saves space and is also a security feature.  I had to modify the collections module so that namedtuple() just returns tuple.  Fortunately, no part of the standard library that uses namedtuple actually uses the actual names, everyone just uses it as a tuple.  So that approach works.

Another problem with the Eval approach is code duplication.

A third could arguably be that there is no namedtuple base class.

Now, replacing namedtuples with tuples works in the standardlib _currentlyt_, but I'm happy to have found an alternative implementation, for future safety.  I only wish it were not hidden away as a diff in a feature request.
History
Date User Action Args
2011-05-12 13:53:23kristjan.jonssonsetrecipients: + kristjan.jonsson, rhettinger, pitrou, audax
2011-05-12 13:53:23kristjan.jonssonsetmessageid: <1305208403.82.0.519378159824.issue3974@psf.upfronthosting.co.za>
2011-05-12 13:53:23kristjan.jonssonlinkissue3974 messages
2011-05-12 13:53:22kristjan.jonssoncreate