On 24 Aug 2006 20:53:49 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > That's bad form. If you insist on doing something like this, at least > use "isinstance(a, str)" instead of typeof. But even that breaks duck > typing; if a is a unicode string, that'll fail when the function may > work fine for unicode strings.
To check both str and unicode, you could use "isinstance(a, basestring)". -- http://mail.python.org/mailman/listinfo/python-list