Is there a reason why Python's ctypes.CDLL cannot automatically generate restype and argtypes from C header files?
<p>For example, it would be nice to be able to do this:</p>

<pre><code>from ctypes import CDLL
mylib = CDLL('/my/path/mylib.so',header='/some/path/mylib.h')
</code></pre>

<p>instead of</p>

<pre><code>from ctypes import *
mylib = CDLL('/my/path/mylib.so')
mylib.f.restype = c_double
mylib.f.argtypes = [c_double, c_double]
mylib.g.restype = c_int
mylib.g.argtypes = [c_double, c_int]
</code></pre>

<p>My experience with python suggests that either something very close to this has been done already and I just haven't been able to find it, or that there is a good reason not to. Are either of these the case?</p>
