Message135835
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. |
|
Date |
User |
Action |
Args |
2011-05-12 13:53:23 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson, rhettinger, pitrou, audax |
2011-05-12 13:53:23 | kristjan.jonsson | set | messageid: <1305208403.82.0.519378159824.issue3974@psf.upfronthosting.co.za> |
2011-05-12 13:53:23 | kristjan.jonsson | link | issue3974 messages |
2011-05-12 13:53:22 | kristjan.jonsson | create | |
|