Kristján Valur Jónsson <krist...@ccpgames.com> added the comment:

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.

----------
nosy: +krisvale

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3974>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to