safe eval of moderately simple math expressions

Joel Hedlund yohell at ifm.liu.se
Sat Apr 11 11:27:06 CEST 2009


Peter Otten wrote:
>> def is_it_safe(source):
>>      return "_" not in source and r'\' not in source
> 
>>>> "".join(map(chr, [95, 95, 110, 111, 95, 95]))
> '__no__'

But you don't have access to neither map or chr?

/Joel



More information about the Python-list mailing list