summaryrefslogtreecommitdiff
path: root/beautifulsoup/util.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-02-21 17:15:02 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-02-21 17:15:02 -0500
commit5a0877c974e75b3ab6177079e3c0a0651402d96c (patch)
tree892b5da9d01d249676bc35d4453eafaf77b62b55 /beautifulsoup/util.py
parent384c5cd07b027b1a53d59d81fd3dc7661cbc2ab1 (diff)
Got rid of isString.
Diffstat (limited to 'beautifulsoup/util.py')
-rw-r--r--beautifulsoup/util.py10
1 files changed, 1 insertions, 9 deletions
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):