easy eval() fix?

Alex Martelli aleaxit at yahoo.com
Wed Oct 15 18:33:36 EDT 2003


Geoff Gerrietts wrote:
   ...
> I'm hoping that there's some module or project out there that I
> haven't seen that will translate simple primitives into python objects
> without doing variable interpolation or expression evaluation, etc.

Given that "simple primitives" ARE "python objects", I'm not too
clear on what you're asking for.  Perhaps marshal.dumps (and
loads to recover the objecs)?  Pickle does evaluate expressions
when reloading from a string (you can't generate an instance of
a generic class without "evaluating and espression"), though.


Alex





More information about the Python-list mailing list