[pypy-dev] utest conversion

holger krekel hpk at trillke.net
Tue Jun 15 20:13:50 CEST 2004


[Armin Rigo Tue, Jun 15, 2004 at 05:56:07PM +0100]
> There was talk about subtle string parsing, or about using Python's parser or
> compiler package, but actually it is much easier than that...  Just try to
> split the text "x,y" between the parenthesis in two halves at every possible
> comma position, until both halves compile without raising SyntaxError :-)

btw, using 

    import parser 
    parser.expr(string) 

is way faster than invoking the whole compiling machinery. Of course,
'compile' doesn't require an import builtin but then again you have to
think up arbitrary arguments to this builtin :-) 

    holger



More information about the Pypy-dev mailing list