<ctismer>
mattip: As you can see, we have this mutable private `m_PyMethodCache` array that records if methods are overwritten with Python.
<ctismer>
mattip: This cache works great in CPython, but PyPy seems to ignore it. Are these objects also read-only or something??
<ctismer>
mattip: cfbolz: I am wondering because I thought only `PyType_Object`s are read-only?
<catern>
has someone already written a nice recursive pretty printer for cdata objects? i.e. something that calls ffi.typeof to figure out the type, prints it, then recurses on the fields/elements?
<cfbolz>
ctismer: I don't quite get how the cache is used
<cfbolz>
Does cpython use that field automatically?
<ctismer>
cfbolz: no, this is completely our construct. It just happens to be ignored. Since it is no PyTypeObject, something else must go wrong.
<cfbolz>
ctismer: yes, that sounds strange
<ctismer>
cfbolz: mattip: I will continue with analysis until I have real evidence. Please ignore my post. But explaining it helped me to understand more 😂
<cfbolz>
Ok 😅
<ctismer>
cfbolz: The cache works correctly! It is the override lookup function that obtains a nonsense override. Hey, it's a long way to Tipperary...
<ctismer>
cfbolz: Does PyPy distinguish between PyFunction and PyCPunction? Something seems fishi there.
<cfbolz>
ctismer: yes, I am not sure we have both
<cfbolz>
I think there is no such a thing as a builtin function
<ctismer>
cfbolz: That might explain a lot. Will investigate further. Hooka hooka 😆
<cfbolz>
>>>> type(list.append) is type(lambda:1)
<cfbolz>
True
<cfbolz>
ctismer: ^^
<ctismer>
cfbolz: Argh. I need to find a new criterion to check when I have an overridden function
<ctismer>
but I might be very close to the first solution, then.
<cfbolz>
ctismer: there might be a way still
<ctismer>
cfbolz: Yes? I am all ears
<cfbolz>
ctismer: the code objects have different types I think
<ctismer>
cfbolz: The function that calculates overrides is a bit complex.
<ctismer>
cfbolz: just FYI, I still don't know where it fails, still looking.
greedom has quit [Ping timeout: 240 seconds]
greedom has joined #pypy
greedom has quit [Remote host closed the connection]
greedom has joined #pypy
<ctismer>
cfbolz: Got it: PyMethod_Check says 1 on PyPy and 0 on CPython
<cfbolz>
right :-(
greedom has quit [Remote host closed the connection]
greedom has joined #pypy
<ctismer>
cfbolz: ok, I need some kind of replacement for `method` vs. `builtin_function_or_method`.
<ctismer>
cfbolz: maybe I could check the module of the function?
<cfbolz>
ctismer: yeah, worth a try
<cfbolz>
for builtin_function_or_method, __module__ seems to be None
greedom has quit [Remote host closed the connection]
greedom has joined #pypy
<ctismer>
cfbolz: yes, but I get `method` from PyPy and need to find out if it is builtin
<ctismer>
cfbolz: The module is NULL
<cfbolz>
ctismer: right, so you should be able to use that
<cfbolz>
C-implemented methods have NULL, python-implemented ones have a module
<cfbolz>
I would think
<ctismer>
cfbolz: Ah, need to prove that in the morning. Thanks!
<cfbolz>
:-)
<cfbolz>
ctismer: thanks for fighting your way through this!
<ctismer>
cfbolz: I have sworn to get this running, and I never-ish give up :)
<ctismer>
cfbolz: In any case, this will work nome way. If nothing helps, I can register all builtin functions in a dict, for instance. Hee hoo, looking forward to tomorrow! 😂
greedom has quit [Remote host closed the connection]