BUT I WANT TO USE help()!!!!!
So instead of wining about the unfairness of life I created the help_support
module that, when imported, will allow you to use help on documented ctypes functions and structures.
It also allows you to document extra stuff like names of ctypes function arguments and they will be displayed too.
https://pypi.org/project/help-support/0.2/
If you ar making Python bindings then include help_support.py and import it to allow poor soles like me to develop faster with your lib.
Real documentation is pain in the A... and I am happy with original Python console.
After doing the obvious thing by adding the doc string to my functions from a C extension, seeing no result in help() and finding no solution on the internet I just couldn't bare such a situation.
So here you are. Now you can use help() on functions pulled from a DLL (in Python 2 at least).
Here's an example:
# examp_module:
import ctypes
import ctypes.util
import help_support
del help_support # If you want you can remove it now
# to avoid cluttering your globals() namespace.
# Once it is called you do not usually need it any more.
l = ctypes.CDLL(ctypes.util.find_library("c"))
# Pull the time() function from libc,
# declare and document it:
time = l.time
time.argtypes = []
#time.argnames = ["c_void"] # The function takes no arguments, but you can trick help_support
# to show something in parenthesis if you want to be consistent with C
# If there is/are argument(s) you should put its/their name(s) in "argnames".
time.restype = ctypes.c_int
time.__doc__ = "Function that returns a system time in seconds."
-------------------------------------------
>>> # Usage:
>>> import examp_module
>>> help(examp_module)
>>> help(examp_module.time)
>>>