From 5a0877c974e75b3ab6177079e3c0a0651402d96c Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 21 Feb 2011 17:15:02 -0500 Subject: Got rid of isString. --- beautifulsoup/util.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'beautifulsoup/util.py') diff --git a/beautifulsoup/util.py b/beautifulsoup/util.py index 693a7e2..5978865 100644 --- a/beautifulsoup/util.py +++ b/beautifulsoup/util.py @@ -9,17 +9,9 @@ except NameError: def isList(l): """Convenience method that works with all 2.x versions of Python to determine whether or not something is listlike.""" - return ((hasattr(l, '__iter__') and not isString(l)) + return ((hasattr(l, '__iter__') and not isinstance(l, basestring)) or (type(l) in (types.ListType, types.TupleType))) -def isString(s): - """Convenience method that works with all 2.x versions of Python - to determine whether or not something is stringlike.""" - try: - return isinstance(s, unicode) or isinstance(s, basestring) - except NameError: - return isinstance(s, str) - def buildSet(args=None): """Turns a list or a string into a set.""" if isinstance(args, str): -- cgit v1.2.3