I have the following code in my interpreter, and I'm getting an
error message I haven't seen before:

    @specialize.call_location()
    def assoc(self, *kws):
        new_dict = {}
        shape = self.get_shape()

        for k in shape.attr_list():
            new_dict[k] = shape.getter_for(k).get_value(self)

        for idx in unrolling_iterable(range(0, len(kws), 2)):
            new_dict[kws[idx]] = kws[idx + 1]

        return DictStruct(new_dict)


It's not efficient, but it's fairly simple, we allow for something like
struct.assoc(k, v, k2, v2). Specialized by call location, so I assume the
*kws size is known. The unrolling_iterable should then give us constant
lookup on the input tuple.

However I get this error during translation:

[translation:ERROR] TyperError: no list() support for <RangeRepr * GcStruct
range { start, stop }>
.. (rpython.rlib.unroll:27)unrolling_iterable.__init__
.. block@6[self_0...] with 1 exits
.. v134 = simple_call((type list), iterable_0)
[translation] start debugger...
> /home/tbaldrid/oss/pypy/rpython/rtyper/rmodel.py(176)rtype_bltn_list()
-> raise TyperError('no list() support for %r' % self)

I've never seen this error before...what should I be doing differently?

Thanks!

Timothy Baldridge
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to