[Python-ideas] List Revolution

Massimo Di Pierro massimo.dipierro at gmail.com
Sat Sep 10 19:05:44 CEST 2011


LOL. 

Damn dollar signs. 
if not re.compile('^[\d\+\*\(\)]+$').match(name): return AttributeError

On Sep 10, 2011, at 11:45 AM, Stefan Behnel wrote:

> Massimo Di Pierro, 10.09.2011 18:35:
>> [...]
>>         if not re.compile('[\d\+\*\(\)]+').match(name): return AttributeError
>> [...]
>> I would like to stress that the use of eval in this case is safe as the expression is first validated against a regex.
> 
> Nice try. And it would even be ok if you had assured that the *entire* expression was validated against the regex.
> 
> Stefan
> 
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas




More information about the Python-ideas mailing list