[Freeipa-devel] Re: [PATCH] check for both str and unicode types

Rob Crittenden rcritten at redhat.com
Thu Feb 21 16:11:40 UTC 2008


Felix Schwarz wrote:
> Robert,
> 
> Rob Crittenden wrote:
>> +def is_string(value):
>> +    """Return True if value is an instance of str or unicode."""
>> +    if (isinstance(value, str) or isinstance(value,unicode)):
>> +        return True
>> +    else:
>> +        return False
> 
> IMHO you should check for "isinstance(value, basestring)" which does
> the right thing (tm).

Thank you, you're right.

New patch attached.

rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-667-unicode.patch
Type: text/x-patch
Size: 5690 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20080221/158e6d7d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20080221/158e6d7d/attachment-0001.bin>


More information about the Freeipa-devel mailing list