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
<antocuni>
because the hpy/rpython dance is very tricky, and we have things which are defined in C, aliased in RPython, rewrapped, etc. etc.
<cfbolz>
ok
<cfbolz>
then I'll fix
<antocuni>
and if you need to wait a full translation to fix them, it becomes impossible
<cfbolz>
committed a hack
<antocuni>
thanks
<antocuni>
cfbolz: I agree that it's a hack, and the fake objspace is full of that
<cfbolz>
antocuni: note that the real fix is actually in unicodeobject.py
<antocuni>
one more datapoint for why RPython is a broken language :(
<antocuni>
ah, I see the fix :(
<antocuni>
here the underlying problem is that we are not able to design interpreters properly :). We have the "objspace" abstraction but often we call things bypassing it, e.g. the unicodeobject helpers
<antocuni>
but I'm confused
<cfbolz>
yep
<antocuni>
does this mean that the ztranslation sees the real objspace.std.W_UnicodeObject? Maybe that's the real problem
<antocuni>
the more proper fix would be to prevent it to see it
<cfbolz>
no, it doesn't
<cfbolz>
it never sees an instantiation
<cfbolz>
but it sees this code:
<cfbolz>
if isinstance(w_obj, W_UnicodeObject) and w_obj.is_ascii():
<antocuni>
ah
<antocuni>
ah, I think that you can put some dummy code inside extra_func in _hpy_universal/test/test_ztraslation
<cfbolz>
the instantiation?
<antocuni>
yes
<cfbolz>
suppose so
<cfbolz>
the more proper fix would indeed be to move encode/decode_object to live on the space
<antocuni>
I mean, its purpose is exactly to convince the annotator to see some hacky code which is needed to pass the ztranslation
<cfbolz>
right
<antocuni>
I agree with the more proper fix, but there is probably more. E.g. look, you need to convince the annotator that W_TypeObject has an hasmro attribute
<mattip>
if you have energy for more, pypy.module._posixsubprocess.test.test_ztranslation is also broken
<mattip>
but there disabling it might be a better option: the code is solid
<cfbolz>
I can look in a bit
<mattip>
maybe we should add "slow" markers to half our tests, and only enable them when annotation fails
<mattip>
but then I guess we will get too many broken tests