Simple and safe evaluator

Aahz aahz at pythoncraft.com
Thu Jun 19 23:54:31 EDT 2008


In article <f407c296-9e02-47a6-8f17-b32332fbfcaf at u12g2000prd.googlegroups.com>,
Simon Forman  <sajmikins at gmail.com> wrote:
>
>FWIW, I got around to implementing a function that checks if a string
>is safe to evaluate (that it consists only of numbers, operators, and
>"(" and ")").  Here it is. :)

What's safe about "10000000 ** 10000000"?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"as long as we like the same operating system, things are cool." --piranha



More information about the Python-list mailing list