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>
mattip: sorry, I read your message only now. Do you still need help?
otisolsen70 has joined #pypy
<mattip>
after sleeping on it, I think rffi.CExternVariable is the way to go
amirouche has joined #pypy
<mattip>
I am still trying to imagine how to modify sys.flags (which get exported to these Py_.*Flag constants) for tests
<mattip>
maybe there is some way to mock them
<antocuni>
what is the actual problem you are trying to solve?
<mattip>
issue 3409
<mattip>
all the sys.flags have c-api equivalents, like sys.flag.optimize is mapped to Py_OptimizeFlag
<antocuni>
I see
<antocuni>
well, thee is also the option of duplicating the flags
<antocuni>
with maybe a test to check that we set them to the same value in rpython and C
<antocuni>
it's probably the simplest, and also it's likely that these values will never change anyway
<mattip>
they are read-only, they should never change, but that means I cannot easily run a translated test
<mattip>
without too much Popen madness
<antocuni>
I fail to see how the problem of keeping them in sync is related to popen
amirouche has left #pypy ["WeeChat 2.8"]
<mattip>
how can I write a test that, for instance, sets sys.flag.optimize and then tests that the value percolates out to Py_OptimizeFlag ?
<mattip>
in order to set sys.flag.optimize I need to mess with starting up the python under test, since sys.flag.optimize is readonly
<antocuni>
or add a special method __pypy__._set_sys_flags_only_for_tests
<antocuni>
also, I see that Py_DebugFlag & co. are global variables in CPython. Maybe for pypy it would be easier to do something like "#define Py_DebugFlag (_PyPy_GetSysFlag(DEBUG))" ?
<mattip>
interesting
<mattip>
hit the first rabbit hole: ">>>> sys.flag.optimize = 3" prints
<mattip>
"AttributeError: module 'sys' has no attribute 'flag'"
<antocuni>
sys.flags?
<mattip>
sorry, "AttributeError: 'sysflags' object has no attribute 'optimize'"
<mattip>
instead of "AttributeError: readonly attribute"
<antocuni>
that's weird
<antocuni>
sys.flags is a _structseq.structseqtype, which seem to raise "readonly attribute" by looking at the code
<cfbolz>
I think the pltalk video is not uploaded anywhere yet
<mattip>
cfbolz: I merged default into py3.7, but I think the descr_replace method on W_ByteObject in objspace/std/bytesobject.py did not survive the merge
<cfbolz>
mattip: OK, can look
<mattip>
annotation is definitely broken
<mattip>
ahh, hang on, something is wrong with my part of the merge
jacob22 has joined #pypy
<cfbolz>
mattip: did you figure it out?
jacob22 has quit [Ping timeout: 245 seconds]
<mattip>
yes, the head of py3.7 now passes annotation. I think it is OK that W_BytesObject is missing a descr_replace on that branch?
<mattip>
it didn't have one before
<cfbolz>
mattip: will look
<mattip>
but then your changes to descr_replace should be somewhere else
<mattip>
thanks
forgottenone has joined #pypy
rguillebert has joined #pypy
jacob22 has joined #pypy
Rhy0lite has joined #pypy
<fijal>
ok, so seems vmprof on aarch64 at least passes a test
jacob22 has quit [Ping timeout: 240 seconds]
Dejan has quit [Ping timeout: 276 seconds]
Dejan has joined #pypy
marky1991 has quit [Ping timeout: 245 seconds]
Rhy0lite has quit [Quit: This computer has gone to sleep]
Rhy0lite has joined #pypy
Rhy0lite has quit [Remote host closed the connection]