diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-21 17:52:51 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-21 17:52:51 -0500 |
commit | f42fef27dc82ce97df0cb7b254595e6771461637 (patch) | |
tree | fb5c145567e730450b9c602ed0585ca1856110f6 /beautifulsoup/util.py | |
parent | 2fa73e2cb99b0816148ade6150f378993907534e (diff) | |
parent | 76bda491e74590c000fc2b15e187fac5a1b599f6 (diff) |
Added a class for converting certain characters into XML or HTML entities, though it's not usable by the end-user yet.
Diffstat (limited to 'beautifulsoup/util.py')
-rw-r--r-- | beautifulsoup/util.py | 10 |
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): |