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
<kenaan>
arigo default ce2c72abde3a /pypy/objspace/std/test/test_newformat.py: Issue #3100 Check in test in 'default', although it passes here, to be sure we don't get a regression later
<kenaan>
arigo py3.6 82e53786ebea /pypy/objspace/std/: Issue #3100 Test and fix
<kenaan>
arigo py3.6 34cc698bbcd1 /: hg merge default This includes the changes to unicodehelper._str_decode_utf8_slowpath(). If these changes were not m...
jvesely has joined #pypy
dddddd has joined #pypy
<Dejan>
Would be nice to merge to 3.7 too
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
antocuni has joined #pypy
YannickJadoul has joined #pypy
<rjarry>
hi guys
<rjarry>
I have a const char * struct field which uses the first byte to store non-string data
xcm has joined #pypy
<rjarry>
I am trying to use slicing to access the string part
<rjarry>
but I get an error:
<rjarry>
return p.expr[1:]
<rjarry>
IndexError: slice stop must be specified
<rjarry>
does that ring a bell to anyone ?
<simpson>
rjarry: `p.expr[1:stop]`, where perhaps `stop = len(p.expr)`, if that operation is supported. You merely need to give a stop for the slice, not just a start.
<rjarry>
simpson: I understand the error but since this is a null terminated string, why don't I get an error when decoding it to unicode ?
<rjarry>
why does it need a stop index when slicing?
<simpson>
I don't know. You'd have to read the source code of the class implementing p.expr to find out.
<rjarry>
ok
<rjarry>
I'll try to figure something out
firespeaker has quit [Quit: Leaving.]
ekaologik has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<cfbolz>
rjarry: maybe try p.expr + 1
<rjarry>
cfbolz: does that make any sense ?
<rjarry>
I managed by decoding the whole buffer to unicode
<cfbolz>
rjarry: yes, it does if you think in C terms, no?
<rjarry>
by chance, the first byte (0x06 or 0x15) "decodable" to unicode
<rjarry>
cfbolz: sure, but in python terms, it does not :D
<rjarry>
I'll try it
<cfbolz>
rjarry: cffi straddles the two languages, as you just discovered when you tried slicing
<cfbolz>
;-)
<rjarry>
:)
<rjarry>
cfbolz: it works, thanks
firespeaker has joined #pypy
ionelmc has quit [Quit: Connection closed for inactivity]
i9zO5AP has quit [Quit: WeeChat 2.5]
Ai9zO5AP has joined #pypy
YannickJadoul has quit [Quit: Leaving]
antocuni has quit [Ping timeout: 265 seconds]
firespeaker has quit [Quit: Leaving.]
marky1991 has quit [Ping timeout: 264 seconds]
marky1991 has joined #pypy
oberstet has joined #pypy
oberstet has quit [Remote host closed the connection]
infernix has quit [Ping timeout: 264 seconds]
ekaologik has quit [Read error: Connection reset by peer]
antocuni has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
Rhy0lite has quit [Quit: Leaving]
infernix has joined #pypy
marky1991 has quit [Ping timeout: 245 seconds]
CrazyPython has joined #pypy
CrazyPython has quit [Remote host closed the connection]
antocuni has quit [Ping timeout: 240 seconds]
asmeurer has joined #pypy
asmeurer has quit [Client Quit]
CrazyPython has joined #pypy
CrazyPython has quit [Remote host closed the connection]
CrazyPython has joined #pypy
firespeaker has joined #pypy
<arigato>
note that p.expr[:] doesn't work either if p.expr is a <cdata 'char *'>
<arigato>
as long as you have <cdata> objects, you need to think in terms of C