diff options
author | Leonard Richardson <leonardr@segfault.org> | 2013-05-07 08:40:35 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2013-05-07 08:40:35 -0400 |
commit | 5b3860ec348b66976de64b5be407704041102869 (patch) | |
tree | e981cbdd77dce9a596dc0a5e1555de47c29923d1 | |
parent | e31151091c3dd44d0f39ba234df261f362199ae5 (diff) |
Aliased the BeautifulSoup class to the easier-to-type "_s" and "_soup".
-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.""" |