ctypes Usage Note

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Wed Aug 3 22:22:05 EDT 2016


On Tuesday, August 2, 2016 at 6:46:45 PM UTC+12, I wrote:

> On Tuesday, August 2, 2016 at 5:18:14 PM UTC+12, eryk sun wrote:
> 
>> I recommend using ctypes.CDLL instead. ctypes.cdll is pretty much
>> pointless on Unix systems (and a potential problem on Windows due to
>> cached function pointers). It also doesn't allow passing the mode,
>> handle, and use_errno parameters.
> 
> None of which I currently care about.

Actually, thinking about it, there might be a point to specifying RTLD_GLOBAL. Which makes me wonder: why isn’t it the default?

As for errno, that’s an egregious piece of POSIX brain damage. You’ll notice that just about nothing else uses it, apart from (the various implementations of) libc, which have to.



More information about the Python-list mailing list