Comment on Want to call C from Python? Use DparentComments−loeg6yctypes allows you to trivially mistype C objects, send the wrong types and number of arguments to C functions, etc. Cffi just imports C headers and gives you more or less what TFA illustrates (without D).−yellowapple6yctypes allows you to trivially mistype C objectsI mean, so does C. Pretty sure that's a "feature". ;)But yeah, fair point; it's definitely nice when an FFI wrapper is able to actually read the header files and figure out function/type signatures.
Comments
ctypes allows you to trivially mistype C objects, send the wrong types and number of arguments to C functions, etc. Cffi just imports C headers and gives you more or less what TFA illustrates (without D).
I mean, so does C. Pretty sure that's a "feature". ;)
But yeah, fair point; it's definitely nice when an FFI wrapper is able to actually read the header files and figure out function/type signatures.