from source code systems. Add factory methods that create Builders
to support BitKeeper, CVS, RCS, SCCS and Subversion.
+ - Make the internal to_String() function more efficient.
+
RELEASE 0.11 - Tue, 11 Feb 2003 05:24:33 -0600
def is_List(e):
return type(e) is types.ListType or isinstance(e, UserList.UserList)
-def to_String(s):
- """Better than str() because it will preserve a unicode
- object without converting it to ASCII."""
- if hasattr(types, 'UnicodeType') and \
- (type(s) is types.UnicodeType or \
- (isinstance(s, UserString) and type(s.data) is types.UnicodeType)):
- return unicode(s)
- else:
- return str(s)
+if hasattr(types, 'UnicodeType'):
+ def to_String(s):
+ if isinstance(s, UserString):
+ t = type(s.data)
+ else:
+ t = type(s)
+ if t is types.UnicodeType:
+ return unicode(s)
+ else:
+ return str(s)
+else:
+ to_String = str
def argmunge(arg):
return Split(arg)