Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment:

I don't think this should happen by default.
but what the user wants is already possible, by using the from_param() method.  
For example, the AutoStrParam type converts everything to a string (and a 
char*):

from ctypes import *

class AutoStrParam(c_char_p):
    @classmethod
    def from_param(cls, value):
        return str(value)

strlen = cdll.LoadLibrary('msvcrt').strlen
strlen.argtypes = [AutoStrParam]

print strlen(None)     # "None"          ->  4
print strlen(type)     # "<type 'type'>" -> 13

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1962>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to