[pypy-dev] Is the built-in re.py supposed to translate?

Alex Gaynor alex.gaynor at gmail.com
Thu Mar 24 02:06:59 CET 2011


On Wed, Mar 23, 2011 at 9:01 PM, Alex Perry <alex.perry at pamurray.com> wrote:

> I'm confused then.  I thought all imports were supposed to go through
> the type emulation before they hit rpython and the nitty gritty of
> translation.  Do I have to get my target.py to load the type emulator
> and then import re.py on top of it?
>
> On Wed, Mar 23, 2011 at 5:51 PM, Alex Gaynor <alex.gaynor at gmail.com>
> wrote:
> >
> >
> > On Wed, Mar 23, 2011 at 8:50 PM, Alex Perry <alex.perry at pamurray.com>
> wrote:
> >>
> >> $ ./pypy-c translate.py target.py
> >> [...]
> >>  AnnotatorError: annotation of <pypy.annotation.dictdef.DictValue
> >> object at 0x0000000004cd7a98> degenerated to SomeObject()
> >>  Simple call of incompatible family:
> >>       (KeyError getting at the binding!)
> >>
> >>  Happened at file /usr/src/pypy/lib-python/2.7.0/re.py line 232
> >>
> >>         cachekey = (type(key[0]),) + key
> >>  ==>     p = _cache.get(cachekey)
> >>         if p is not None:
> >>
> >>  Previous annotation:
> >>   (none)
> >>  Processing block:
> >>  block at 9 is a <class 'pypy.objspace.flow.flowcontext.SpamBlock'>
> >>  in (re:229)_compile__star_2
> >>  containing the following operations:
> >>        v0 = getitem(key_0, (0))
> >>        v1 = type(v0)
> >>        v2 = newtuple(v1)
> >>        v3 = add(v2, key_0)
> >>        v4 = simple_call((method get), v3)
> >>        v5 = is_(v4, (None))
> >>        v6 = is_true(v5)
> >>  --end--
> >>
> >> $ cat target.py
> >> #! /usr/bin/python2.6
> >>
> >> def entry_point(argv):
> >>  import re
> >>  s = re.sub(r'[^a-fA-F\d]', '', str(argv[1]))
> >>  print s.decode('hex')
> >>
> >> def target(*args):
> >>  return entry_point, None
> >>
> >> if __name__ == '__main__':
> >>  import sys
> >>  entry_point(sys.argv)
> >> _______________________________________________
> >> pypy-dev at codespeak.net
> >> http://codespeak.net/mailman/listinfo/pypy-dev
> >
> > Nope, basically nothing in the stdlib is RPython.
> >
> > Alex
> >
> > --
> > "I disapprove of what you say, but I will defend to the death your right
> to
> > say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
> > "The people's good is the highest law." -- Cicero
> >
> >
>

I'm not sure I follow, what is the type emulator?

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110323/a624fc22/attachment.html>


More information about the Pypy-dev mailing list