[I18n-sig] Strawman Proposal: Smart String Test

Paul Prescod paulp@ActiveState.com
Thu, 08 Feb 2001 16:24:39 -0800


The types module will contain a new function called 

isstring(obj)

types.isstring returns true if the object could be directly interpreted
as a string. This is defined as: "implements the string interface and is
compatible with the re regular expression engine." At the moment no user
types fit this criteria so there is no mechanism for extending the
behavior of the types.isstring function yet. It's initial behavior is:

def isstring(obj):
    return type(obj) in (StringType, UnicodeType)

 Paul Prescod