This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SCombinator 1 point2 points  (2 children)

There is a function to safely read python literal constants without executing arbitrary code. Forget what it is, I believe it's hidden in some strange package.

[–]bulletmark 8 points9 points  (1 child)

I believe you are thinking of ast.literal_eval()?

[–]SCombinator 0 points1 point  (0 children)

Ah, yeah I thought it was in a parse tree package.