From f7e49815dfcd427af639b1e3f9aefcf4f8f581e4 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sat, 21 May 2011 11:14:01 -0400 Subject: Got rid of isList utility function. --- bs4/util.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bs4/util.py (limited to 'bs4/util.py') diff --git a/bs4/util.py b/bs4/util.py new file mode 100644 index 0000000..3cfeaf5 --- /dev/null +++ b/bs4/util.py @@ -0,0 +1,15 @@ +# Helper functions and mixin classes for Beautiful Soup + +import types +try: + set +except NameError: + from sets import Set as set + +def buildSet(args=None): + """Turns a list or a string into a set.""" + if isinstance(args, str): + return set([args]) + if args is None: + return set() + return set(args) -- cgit v1.2.3