[pypy-dev] The correct way to incrementally build list in RPython
Yichao Yu
yyc1992 at gmail.com
Fri Jun 27 04:09:35 CEST 2014
Hi,
On an attempt to fix the hash function of numpy.dtype, I came up with
the patch in the attachment translated from hashdescr.c in the
original numpy source. The patch passed the test when running in
pyinteractive.py. However, when started to translate pypy, I get an
ListChangeUnallowed error.
I read in the Coding Guide that list.append should be allowed (which
also said there's a lot of special rules) and I have seen usage of
append in other RPython modules. So what is the rule of using
list.append and what is the best way of doing this? (I guess I can
always using application level lists but is that the only/best way?)
Other comments on this patch (style/naming etc) are also welcome.
Yichao Yu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpy-hash.patch
Type: text/x-patch
Size: 1712 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20140627/c5658f1e/attachment.bin>
More information about the pypy-dev
mailing list