Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #105975

Re: newbie question

From "Sven R. Kunze" <srkunze@mail.de>
Newsgroups comp.lang.python
Subject Re: newbie question
Date 2016-03-29 12:23 +0200
Message-ID <mailman.144.1459247027.28225.python-list@python.org> (permalink)
References <56f3c3eb$0$4546$426a74cc@news.free.fr> <CAG93HwFywmkHdBMXMKOKCu7S6mHtvjZt5Lenzb8tG-aKigwm=Q@mail.gmail.com> <56F3CB1E.2000606@mail.de> <mailman.92.1458825746.2244.python-list@python.org> <56f94f18$0$3314$426a34cc@news.free.fr>

Show all headers | View raw



On 28.03.2016 17:34, ast wrote:
>
> "Matt Wheeler" <m@funkyhat.org> a écrit dans le message de 
> news:mailman.92.1458825746.2244.python-list@python.org...
>> On Thu, 24 Mar 2016 11:10 Sven R. Kunze, <srkunze@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

newbie question "ast" <nomail@com.invalid> - 2016-03-24 11:39 +0100
  Re: newbie question David Palao <dpalao.python@gmail.com> - 2016-03-24 11:49 +0100
    Re: newbie question "ast" <nomail@com.invalid> - 2016-03-24 11:54 +0100
    Re: newbie question Steven D'Aprano <steve@pearwood.info> - 2016-03-25 00:53 +1100
      Re: newbie question Grant Edwards <invalid@invalid.invalid> - 2016-03-24 15:05 +0000
        Re: newbie question wxjmfauth@gmail.com - 2016-03-24 10:11 -0700
  Re: newbie question Matt Wheeler <m@funkyhat.org> - 2016-03-24 10:57 +0000
  Re: newbie question Tim Chase <python.list@tim.thechases.com> - 2016-03-24 05:58 -0500
  Re: newbie question "Sven R. Kunze" <srkunze@mail.de> - 2016-03-24 12:10 +0100
  Re: newbie question Steven D'Aprano <steve@pearwood.info> - 2016-03-24 22:13 +1100
  Re: newbie question Matt Wheeler <m@funkyhat.org> - 2016-03-24 13:22 +0000
    Re: newbie question "ast" <nomail@com.invalid> - 2016-03-28 17:34 +0200
      Re: newbie question "Sven R. Kunze" <srkunze@mail.de> - 2016-03-29 12:23 +0200
  Re: newbie question "Sven R. Kunze" <srkunze@mail.de> - 2016-03-24 18:47 +0100

csiph-web