[Python-ideas] List Revolution

Guido van Rossum guido at python.org
Sat Sep 10 20:00:24 CEST 2011


I thought we were all just having a little bit of fun with what's
obviously the least-likely-to-be-accepted proposal to have hit
python-ideas in a long time; and now I see serious questions about it
on Twitter and Quora... Time to start adding smileys to all posts! :-)

(Though seriously, Massimo, you should be able to implement the same
idea without using eval() at all.)

--Guido

On Sat, Sep 10, 2011 at 10:50 AM, Massimo Di Pierro
<massimo.dipierro at gmail.com> wrote:
> Anyway ... mine was not a serious proposal. I like python lists as they are.
>
> On Sep 10, 2011, at 12:43 PM, Devin Jeanpierre wrote:
>
>>> Damn dollar signs.
>>> if not re.compile('^[\d\+\*\(\)]+$').match(name): return AttributeError
>>
>> '(2**1024)**(2**1024)' etc.
>>
>> Devin
>>
>> On Sat, Sep 10, 2011 at 1:05 PM, Massimo Di Pierro
>> <massimo.dipierro at gmail.com> wrote:
>>> 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
>>>
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> http://mail.python.org/mailman/listinfo/python-ideas
>>>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list