newbie question

Sven R. Kunze srkunze at mail.de
Tue Mar 29 06:23:39 EDT 2016



On 28.03.2016 17:34, ast wrote:
>
> "Matt Wheeler" <m at funkyhat.org> a écrit dans le message de 
> news:mailman.92.1458825746.2244.python-list at python.org...
>> On Thu, 24 Mar 2016 11:10 Sven R. Kunze, <srkunze at mail.de> wrote:
>>
>>> On 24.03.2016 11:57, Matt Wheeler wrote:
>>> >>>> import ast
>>> >>>> s = "(1, 2, 3, 4)"
>>> >>>> t = ast.literal_eval(s)
>>> >>>> t
>>> > (1, 2, 3, 4)
>>>
>>> I suppose that's the better solution in terms of safety.
>>>
>>
>> It has the added advantage that the enquirer gets to import a module 
>> that
>> shares their name ;)
>
>
> I had a look at that "ast" module doc, but I must admit that
> I didn't understood a lot of things.

If there were a module "srkunze", I think, I would be equally surprised. ;)

Best,
Sven



More information about the Python-list mailing list