[pypy-dev] Re: [pypy-svn] r16013 - in pypy/dist/pypy/interpreter/pyparser: . test

Armin Rigo arigo at tunes.org
Mon Aug 15 23:51:33 CEST 2005


Hi Adrien,

On Fri, Aug 12, 2005 at 06:11:51PM +0200, adim at codespeak.net wrote:
>  - don't use eval() builtin anymore in eval_number() and eval_string(). The
>    replacement implementation is incomplete though, so it needs to be 
>    finished (esp. for raw/unicode strings, and 0x-like numbers)

We have done this code during the last sprint, "en passant".  Sorry, I
intended to mention it here but forgot.  We needed it because the
app-level ast transformer from the stdlib also uses eval() to get
literals, but this causes an infinite recursion (eval() at app-level
causes the compiler to be called, which uses the ast transformer again).

The code is:
* for string literals: interpreter/pyparser/parsestring.parsestr()
* for numeric literals:
          lib/_stablecompiler/transformer.decode_numeric_literal()

The latter is not RPython but it's not too long either.  Getting these
right was a bit involved so I guess there is no point in duplicating the
effort...


A bientot,

Armin



More information about the Pypy-dev mailing list