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


Groups > comp.lang.python > #45655

Re: Question about ast.literal_eval

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'pop': 0.05; 'subject:Question': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:skip:a 10': 0.09; 'python': 0.11; 'suggest': 0.14; 'ast': 0.16; 'bracket,': 0.16; 'brackets.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'think.': 0.16; 'wrote:': 0.18; 'stack': 0.19; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'url:moin': 0.24; 'push': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'url:wiki': 0.31; 'url:python': 0.33; 'something': 0.35; 'url:org': 0.36; 'level': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; "you're": 0.61; 'address': 0.63; 'pick': 0.64; 'charset:windows-1252': 0.65; 'results': 0.69; 'received:89': 0.85; 'walking': 0.91; 'imagine': 0.93; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Question about ast.literal_eval
Date Tue, 21 May 2013 10:00:48 +0100
References <knci07$jol$1@ger.gmane.org> <BLU176-W37EB377C73CD6D7306247DD7AF0@phx.gbl> <knckj0$cft$1@ger.gmane.org> <CAPTjJmpb073XFH5ksNhzRyAJNSJF=6WNq5pGzed4PXqBrJBN=A@mail.gmail.com> <knclk6$lva$1@ger.gmane.org> <mailman.1888.1369056365.3114.python-list@python.org> <519a4b6a$0$29997$c3e8da3$5496439d@news.astraweb.com> <mailman.1905.1369117820.3114.python-list@python.org> <519b2096$0$6574$c3e8da3$5496439d@news.astraweb.com> <knf9u3$rr0$1@ger.gmane.org> <CAA=1kxRdVJYVD8CGrmJ-033P7yGiRzvZTaXC-wZ-CY8axA3=2Q@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host host-89-240-174-199.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
In-Reply-To <CAA=1kxRdVJYVD8CGrmJ-033P7yGiRzvZTaXC-wZ-CY8axA3=2Q@mail.gmail.com>
X-Antivirus avast! (VPS 130520-1, 20/05/2013), Outbound message
X-Antivirus-Status Clean
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1911.1369126836.3114.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369126836 news.xs4all.nl 15993 [2001:888:2000:d::a6]:55170
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:45655

Show key headers only | View raw


On 21/05/2013 09:23, Fábio Santos wrote:
>
> On 21 May 2013 09:10, "Frank Millman" <frank@chagford.com
> <mailto:frank@chagford.com>> wrote:
>  > It doesn't address the issue of brackets. I imagine that the answer
> is something like -
>  >
>  >   maintain a stack of results
>  >   for each left bracket, push a level
>  >   for each right bracket, pop the result
>  >
>  > or something ...
>  >
>
> Time for me to suggest pyparsing or PLY. You're better off creating your
> own AST and walking it to produce python or SQL than reinventing the
> wheel, I think.
>

Or pick one from this lot http://nedbatchelder.com/text/python-parsers.html

-- 
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.

Mark Lawrence

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


Thread

Re: Question about ast.literal_eval Frank Millman <frank@chagford.com> - 2013-05-20 15:26 +0200
  Re: Question about ast.literal_eval Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-20 16:12 +0000
    Re: Question about ast.literal_eval Chris Angelico <rosuav@gmail.com> - 2013-05-21 02:23 +1000
    Re: Question about ast.literal_eval Frank Millman <frank@chagford.com> - 2013-05-21 08:30 +0200
      Re: Question about ast.literal_eval Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-21 07:21 +0000
        Re: Question about ast.literal_eval Frank Millman <frank@chagford.com> - 2013-05-21 10:06 +0200
        Re: Question about ast.literal_eval Fábio Santos <fabiosantosart@gmail.com> - 2013-05-21 09:23 +0100
        Re: Question about ast.literal_eval Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-21 10:00 +0100

csiph-web