diff options
-rw-r--r-- | NEWS.txt | 7 | ||||
-rw-r--r-- | bs4/__init__.py | 4 |
2 files changed, 11 insertions, 0 deletions
@@ -8,6 +8,13 @@ you strings that are visible in the document--no comments or processing commands. [bug=1050164] +* The BeautifulSoup class is now aliased to "_s" and "_soup", making + it quicker to type an import statement in an interactive session: + + from bs4 import _s + or + from bs4 import _soup + * Fix a bug in the html5lib treebuilder which sometimes created disconnected trees. [bug=1039527] diff --git a/bs4/__init__.py b/bs4/__init__.py index fe2656b..88177d6 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -335,6 +335,10 @@ class BeautifulSoup(Tag): return prefix + super(BeautifulSoup, self).decode( indent_level, eventual_encoding, formatter) +# Alias to make it easier to type import: 'from bs4 import _soup' +_s = BeautifulSoup +_soup = BeautifulSoup + class BeautifulStoneSoup(BeautifulSoup): """Deprecated interface to an XML parser.""" |