announce: FAQs suggested
Thomas Heller
theller at ctypes.org
Fri Nov 10 15:09:35 EST 2006
p.lavarre at ieee.org schrieb:
> Thanks again for making time to comment - insights into the perspective
> of the author are invaluable. But if by chance you have time to
> continue:
>
>> > > http://effbot.org/pyfaq/suggest.htm
>> > http://docs.python.org/dev/lib/ctypes-return-types.html
>> A note could probably be added to this section.
>
> Good. Next: Is there a place on the web where we can log that
> conclusion to inspire its resolution?
The canonical place is the Python bug tracker. Best would be to suggest a sentence
or two for the docs.
Presonally, I would suggest to add something like this to the start of the docs, section 14.14.1.8:
"""
14.14.1.8 Return types
By default functions are assumed to return the C int type. Other return types can be specified by setting the restype attribute of the function object.
-> For functions that do not return anything, restype should be set to None.
"""
>> > void is missing from
>> > http://docs.python.org/dev/lib/node452.html "Fundamental data types"
>>
>> 'void' is not a type.
>
> Help, lost me?
What I mean is that you cannot create 'variables' of type void in C, so I would
say it is not a type. Do you think that ctypes should define
c_void = None
somewhere?
I think that would really be confusing. Consider:
>>> c_int(42)
c_int(42)
>>> c_void()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'NoneType' object is not callable
>>>
OTOH, void* is a type in C, also in ctypes, where it is spelled 'c_void_p'.
I hope this makes sense to you.
Thomas
More information about the Python-list
mailing list