This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients BreamoreBoy, amaury.forgeotdarc, christian.heimes, mattbaas, theller
Date 2010-09-21.17:56:49
SpamBayes Score 0.00075835973
Marked as misclassified No
Message-id <1285091811.49.0.420301391412.issue1962@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2010-09-21 17:56:51amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, theller, christian.heimes, mattbaas, BreamoreBoy
2010-09-21 17:56:51amaury.forgeotdarcsetmessageid: <1285091811.49.0.420301391412.issue1962@psf.upfronthosting.co.za>
2010-09-21 17:56:49amaury.forgeotdarclinkissue1962 messages
2010-09-21 17:56:49amaury.forgeotdarccreate