00:54
lritter has quit [Ping timeout: 246 seconds]
01:56
oberstet__ has quit [Remote host closed the connection]
01:59
xcm has quit [Remote host closed the connection]
02:01
xcm has joined #pypy
03:41
Rhy0lite has quit [Quit: This computer has gone to sleep]
05:04
xcm has quit [Remote host closed the connection]
05:05
xcm has joined #pypy
06:25
marvin has quit [Remote host closed the connection]
06:26
marvin has joined #pypy
06:56
altendky has quit [Ping timeout: 260 seconds]
06:57
altendky has joined #pypy
07:16
<
mattip >
dunno what I did, but latest win32 py3.6 crashes when run at the repl
07:42
oberstet has joined #pypy
07:46
Masklinn has joined #pypy
08:01
Masklinn has quit []
08:07
stillinbeta has quit [Ping timeout: 272 seconds]
08:09
Masklinn has joined #pypy
08:09
stillinbeta has joined #pypy
08:20
<
mattip >
arigo: on issue 3267, thanks for not recommending the latest nightly :)
08:45
oberstet_ has joined #pypy
08:47
oberstet has quit [Ping timeout: 264 seconds]
08:49
oberstet__ has joined #pypy
08:51
petronny has joined #pypy
08:52
oberstet_ has quit [Ping timeout: 258 seconds]
09:08
<
rjarry >
anyone has experience in adding typing hints for cffi extensions?
10:41
epony has quit [Quit: reconfigure]
10:43
epony has joined #pypy
11:04
xcm has quit [Remote host closed the connection]
11:06
xcm has joined #pypy
11:17
nimaje has quit [Quit: WeeChat 2.8]
11:19
nimaje has joined #pypy
11:20
oberstet_ has joined #pypy
11:22
oberstet__ has quit [Ping timeout: 256 seconds]
11:24
oberstet__ has joined #pypy
11:27
oberstet_ has quit [Ping timeout: 256 seconds]
11:43
Rhy0lite has joined #pypy
12:00
nimaje has quit [Read error: Connection timed out]
12:00
nimaje has joined #pypy
12:19
oberstet_ has joined #pypy
12:22
oberstet__ has quit [Ping timeout: 256 seconds]
12:24
oberstet__ has joined #pypy
12:26
oberstet_ has quit [Ping timeout: 256 seconds]
12:54
speeder39_ has joined #pypy
13:16
lritter has joined #pypy
13:56
Masklinn has quit []
14:29
eregon_ has quit [Ping timeout: 258 seconds]
14:30
eregon has joined #pypy
14:42
<
pmp-p >
hi rjarry what do you want to achieve ?
14:42
<
rjarry >
pmp-p: hi, I am working on CFFI wrappers around C libraries and I would like to use mypy
14:43
<
rjarry >
which requires to add type annotations on function/variables
14:43
<
pmp-p >
interesting
14:43
<
rjarry >
however, when working on CFFI extensions, the compiled extension is generated
14:44
<
rjarry >
so that kind of requires to add a stub file
14:44
<
pmp-p >
what would you do if you find void some_c_func(int a) and void some_c_func(float a) in the C exports list ?
14:44
<
pmp-p >
with annotations
14:45
<
rjarry >
def some_c_func(a: int) -> None: ...
14:45
<
rjarry >
def some_c_func(a: float) -> None: ...
14:45
<
rjarry >
for example
14:45
<
rjarry >
the problem I have is that some C objects are too complex to be native python types
14:45
<
rjarry >
they are wrapped in ffi.CData objects
14:46
<
rjarry >
but there is no "subclass" of CData
14:46
<
pmp-p >
use boxed pointers then
14:46
<
rjarry >
so I have no idea how to declare these types
14:46
<
rjarry >
for example "void *" or "char *"
14:46
<
rjarry >
boxed pointers ?
14:48
<
rjarry >
I wonder if CFFI could generate these .pyi stub files directly
14:48
<
pmp-p >
yeah use specific python type to say "this thing is a c/c++ pointer" when on the stack before call you can replace it
14:48
<
pmp-p >
same when returning value
14:49
<
rjarry >
I don't understand what you mean, sorry :)
14:49
<
pmp-p >
also problem with annotation is that the second "some_c_func" mask the first
14:52
<
pmp-p >
so stubs are interesting
14:53
<
rjarry >
yes, I seems to me that they could be generated automatically by cffi when it generates the .c extension code
14:54
<
mattip >
pmp-p: if you have void some_c_func(int a) and void some_c_func(float a) in an exported C interface, something is terribly wrong
14:55
<
mattip >
you will only see some_c_func in the eports, and not be able to choose between them
14:55
<
pmp-p >
mattip: yeah but sometimes it happens with C++
14:55
<
rjarry >
I'm not sure what it means in C
14:55
<
pmp-p >
also sometimes c++ have init values :(
14:55
<
rjarry >
I don't think that function overloading in C is possible
14:55
<
mattip >
but then the signature is some garbled mess for cffi
14:56
<
pmp-p >
luckily it was corner cases :D
14:56
<
mattip >
I don't even know if the pycparser will work on a C++ interface header
14:56
<
rjarry >
pmp-p: you need to write c++ffi
14:57
<
pmp-p >
i did not try pycparser, i guess cppyy or interrogate (what i used) are better for that
14:57
<
rjarry >
mattip: did you ever consider generating stub files when building extensions?
14:58
<
rjarry >
is it something anyone ever suggested?
14:59
<
pmp-p >
rjarry: idk but i certainly will try to generate them for my experiment, so thx for letting me know about them
14:59
<
mattip >
rjarry: it is a thing, look up cppyy
14:59
<
rjarry >
mattip: that's C++, ahh
15:00
<
mattip >
sorry, I am in a lag. cppyy is a c++ffi
15:14
xcm has quit [Remote host closed the connection]
15:16
xcm has joined #pypy
15:32
<
rjarry >
mattip: btw, you did not answer my original question
15:33
<
rjarry >
do you think that cffi could be modified so that it generates .pyi stub files when generating the C extension code?
15:45
<
mattip >
anything is possible. I don't know much about typing conventions
15:45
<
mattip >
definitely would need tests to confirm it is working
15:49
<
pmp-p >
i've seen docstrings generated from cffi in pysdl2-cffi but not annotations, maybe it can help
16:27
<
rjarry >
mattip: I'm not sure I have enough knowledge of the inner workings of cffi to attempt such a change by myself
16:27
<
rjarry >
however, I'd like to help if possible
16:37
<
mattip >
maybe ask on the cffi-dev mailing list or file an issue
16:47
Olorin_ has joined #pypy
16:47
jeroud_ has joined #pypy
16:48
string_ has joined #pypy
16:54
<
rjarry >
mattip: I posted a message on the mailing list
16:55
string has quit [*.net *.split]
16:55
jeroud has quit [*.net *.split]
16:55
krono has quit [*.net *.split]
16:55
Olorin has quit [*.net *.split]
16:55
avakdh has quit [*.net *.split]
16:55
ronan has quit [*.net *.split]
16:55
dstufft has quit [*.net *.split]
16:55
_aegis_ has quit [*.net *.split]
16:55
string_ is now known as string
16:55
Olorin_ is now known as Olorin
16:55
jeroud_ is now known as jeroud
16:56
agates[m] has quit [Write error: Connection reset by peer]
16:56
the_drow[m] has quit [Remote host closed the connection]
16:56
toad_polo has quit [Remote host closed the connection]
16:57
_aegis_ has joined #pypy
16:58
krono has joined #pypy
16:58
dstufft has joined #pypy
16:58
avakdh has joined #pypy
16:58
ronan has joined #pypy
17:02
agates[m] has joined #pypy
17:26
toad_polo has joined #pypy
17:26
the_drow[m] has joined #pypy
18:18
BPL has joined #pypy
18:45
xcm has quit [Remote host closed the connection]
18:46
xcm has joined #pypy
19:34
speeder39_ has quit [Quit: Connection closed for inactivity]
19:42
<
mattip >
it took me a while to realize that I can create a PyCFunctionObject in a test very easily by just writing a module function :)
20:17
xcm has quit [Read error: Connection reset by peer]
20:18
xcm has joined #pypy
21:32
BPL has quit [Quit: Leaving]
22:24
xcm has quit [Remote host closed the connection]
22:26
xcm has joined #pypy
22:40
xcm has quit [Killed (orwell.freenode.net (Nickname regained by services))]
22:41
xcm has joined #pypy
23:58
oberstet__ has quit [Remote host closed the connection]