cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
oberstet has quit [Remote host closed the connection]
YannickJadoul has quit [Quit: Leaving]
epony has quit [Remote host closed the connection]
<antocuni>
mattip: I commented out the call to newlist and started a new translation, to see whether the problem is when we union the two annotations
<antocuni>
yes, by commenting out the call to newlist, it works
epony has joined #pypy
<mattip>
ok, so it is trying to merge the two callsites?
<antocuni>
I think it is correct
<antocuni>
as soon as I pass items_w to newlist, it correctly becomes non-resizable (because once it is inside a list, it can be resized, of course)
<antocuni>
but newtuple wants a different type
<antocuni>
I mean, if we wrote it in C it would be evident because newlist and newtuple take two different C types
<antocuni>
RPython is a very weird language
<antocuni>
I suppose the proper fix is to unshare the code between TupleBuilder and ListBuilder
<mattip>
you could make a base class and two subclasses, but in this case it might be overkill
<antocuni>
I don't think it works
<antocuni>
because self.items_w would be shared anyway
<antocuni>
I can probably use some RPython trick to write the class only once and get two different copies, though
<mattip>
:shrug: maybe not worth the effort
jacob22_ has joined #pypy
<antocuni>
another easy trick is to do "space.newtuple(self.items_w[:])"
Civil has joined #pypy
jacob22 has quit [Ping timeout: 240 seconds]
Civilian has quit [Ping timeout: 240 seconds]
<antocuni>
or maybe the opposite, i.e. to make the copy in the ListBuilder case: I suspect it is more common to create a tuple than to create a pre-resized list and fill it with elements