cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | the secret reason for us trying to get PyPy users: to test the JIT well enough that we're somewhat confident about it
adamholmberg has quit [Remote host closed the connection]
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
amaury has joined #pypy
__peke___ has quit [Excess Flood]
__peke__ has joined #pypy
adamholmberg has joined #pypy
amaury has quit [Ping timeout: 264 seconds]
demonimin_ is now known as demonimin
tbodt has joined #pypy
mattip has joined #pypy
lweber1 has quit [Ping timeout: 248 seconds]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
tbodt has quit [Client Quit]
tbodt has joined #pypy
tbodt has quit [Client Quit]
<mattip>
arigato: ping
inad922 has joined #pypy
<arigato>
mattip: pong
<antocuni>
what is the blessed way to add an integer constant to a W_* class?
<mattip>
arigato: in dc1bf38e9aed I tried to test the places that use is_cpytype(), and the translated tests pass, but more generally
<mattip>
should a user-defined non-c-api subclass of a cpytype have is_cpytype() == True?
<antocuni>
I see that there is typedef.ClassAttr, which invokes a function to compute the result; but the docstring seems to suggest that there is also an alternative way to avoid writing the function itself
<arigato>
unsure about the relationship between is_cpytype() and dc1bf38e9aed
<arigato>
mattip: I'm not sure, but I think the answer is "yes like so far" for at least a number of users of is_cpytype()
<mattip>
arigato: the places that use is_cpytype() are in mutated() and __module__, __name__ of a type
<mattip>
arigato: so I added passing translated tests that show that is_cpytype() can be False for a user-defined type
<arigato>
ok, but you or me would need to check all usages of is_cpytype() to know that
<arigato>
at least so far, it was meant to be true for that case, I think
<arigato>
but there might have been issues with some of these use cases indeed
lritter has joined #pypy
<arigato>
sorry, can't be more precise, I don't have the usual access to the sources right now
<mattip>
the only use case I left untested is the decref(tp_dict) in cpyext/typeobject.py
<mattip>
ahh, ok
<antocuni>
ah, apparently putting "FOO = 42" in the typedef is enough to have it exposed at appleve
<mattip>
arigato: your comments yesterday left me confused, the pastebin seems like it would have the opposite effect from the desired one
<mattip>
but we can postpone the discussion until you can scan sources
<arigato>
W_PyCTypeObject should be used only for types that come from a PyTypeObject originally
<arigato>
so a user-defined subclass should, I think, not be a W_PyCTypeObject
<mattip>
the first part makes W_BaseCPyObject, W_TypeObject, W_NoneObject, W_BoolObject become slower
<arigato>
well, no
<arigato>
or yes, except for None and Bool it changes nothing because these objects never die; for types themselves it was probably wrong to use link_pyobj() at all because types can be mutated from Python---or even if they can't, I don't think we care about the performance of freeing types
<arigato>
and for W_BaseCPyObject, yes, it makes them slower and correct, *except* when their types are actually W_PyCTypeObject
<arigato>
in which case we use the version in W_PyCTypeObject which is the fast one
inad922 has quit [Ping timeout: 240 seconds]
<mattip>
ahh, got it, thanks
<arigato>
so by default it uses the slower and correct version, and in the one case where we care it should use the fast version
<arigato>
I think it should come with a test that a user-defined subclass is really not a W_PyCTypeObject
<mattip>
+1, will try. I will also leave the tests for is_cpytype() usage ( dc1bf38e9aed) and revert 36ff2c150968 (about w_obj.flag_cpytype in tyep creation)
<mattip>
arigato: cpyext-subclass-setattr passes tests, and in 85beaaee87c8 I added a test that a user-defined subclass is really not a W_PyCTypeObject
dddddd has quit [Ping timeout: 248 seconds]
lritter has quit [Remote host closed the connection]
drolando has quit [Read error: Connection reset by peer]
drolando has joined #pypy
<kenaan>
mattip default dbe5e735e9f7 /pypy/doc/: start release notes (up to 24.2.2018), rename whatsnew to fit convention