I've checked in a dict-based version. Not sure it became that clean after all. Is the getattr(space, tc.unwrap) construction ok?
On Mon, Jul 5, 2010 at 7:26 AM, Hakan Ardo <[email protected]> wrote: > On Sun, Jul 4, 2010 at 10:25 PM, Maciej Fijalkowski <[email protected]> wrote: >> >> Hey. This looks a bit ugly, > > It does, doesn't it :) > >> you can definitely do it with some >> constant dict or something > > Yes, there is an overflow check needed on the integer types but not on > the character an float types, but I guess that could be solved with a > flag in the dict. > > I was actually considering to introduce separate subclasses for each > typecode overriding intem_w and descr_getitem. That would get rid of > the typecode attribute lookup all together. > >> (we have special support for iterating over >> constants and unrolling the iteration, look for unrolling_iterable). >> Also, annotator can fold a bunch of ifs into a switch, but not if "in" >> operator is used (or is fine though). > > That's nice features, good to know about. Thanx. > > > > -- > Håkan Ardö > -- Håkan Ardö _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
