safe eval of moderately simple math expressions

Joel Hedlund yohell at ifm.liu.se
Sat Apr 11 05:27:06 EDT 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