3 ms·
http://doc.pypy.org/en/latest/release-1.8.0.html http://doc.pypy.org/en/latest/release-1.8.0.html It does this since 1.8 it seems (mentioned under 'list special
by ludamad 10y ago
http://doc.pypy.org/en/latest/release-1.8.0.html http://doc.pypy.org/en/latest/release-1.8.0.html
It does this since 1.8 it seems (mentioned under 'list specialization'). Probably 'type inference' isn't the right way to describe it. It will optimistically assume it's a homogeneous array and will have to recreate this array if the assumption is broken. This will be useful in the vast majority of cases, as mixed type arrays are not usually used in performance-sensitive code.
- rlayton2 10y agoFurther, there is almost always a better data structure for any mixed-type list. So if you know your code will go through pypy, you can just use a different structure.