Convert obejct string repr to actual object

Steven D'Aprano steve at
Tue Oct 9 00:47:23 CEST 2007

On Mon, 08 Oct 2007 21:19:50 +0200, Tor Erik Sønvisen

> I don't want to use eval, since I can't trust the source sending the
> object.... I'm sure someone must have had the same need and created code
> for it... Maybe Pypy has what I need??? Haven't looked though...

For the benefit of those who think they can make eval "safe", start here:

Here's a good solution:


More information about the Python-list mailing list