summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG5
-rw-r--r--beautifulsoup/element.py7
2 files changed, 10 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 50502cf..4ca67ec 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,11 @@
Methods have been renamed for comply with PEP 8. findAll is now
find_all, and so on. Old names still work.
+ * findAll -> find_all
+ * childGenerator -> children
+ * recursiveChildGenerator -> recursive_children
+
+
tag.string now operates recursively. If tag A contains a single tag B
and nothing else, then A.string is the same as B.string. So:
diff --git a/beautifulsoup/element.py b/beautifulsoup/element.py
index 869be4d..8170250 100644
--- a/beautifulsoup/element.py
+++ b/beautifulsoup/element.py
@@ -686,7 +686,7 @@ class Tag(PageElement, Entities):
callable that takes a string and returns whether or not the
string matches for some custom definition of 'matches'. The
same is true of the tag name."""
- generator = self.recursiveChildGenerator
+ generator = self.recursive_children
if not recursive:
generator = self.childGenerator
return self._find_all(name, attrs, text, limit, generator, **kwargs)
@@ -712,7 +712,7 @@ class Tag(PageElement, Entities):
yield self.contents[i]
raise StopIteration
- def recursiveChildGenerator(self):
+ def recursive_children(self):
if not len(self.contents):
raise StopIteration
stopNode = self._lastRecursiveChild().next
@@ -720,6 +720,9 @@ class Tag(PageElement, Entities):
while current is not stopNode:
yield current
current = current.next
+ # Old name for backwards compatibility
+ recursiveChildGenerator = recursive_children
+
# Next, a couple classes to represent queries and their results.
class SoupStrainer: