diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-18 07:18:17 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-18 07:18:17 -0500 |
commit | b3f9af67ac362860133c6041c557ad02b43d6764 (patch) | |
tree | 9ce30389df94a545698f85a0ef7912820c7bfbd9 /beautifulsoup/element.py | |
parent | 1c9359dbdf3266d35ea87ed0fa8e197855dcd84b (diff) |
Renamed a straggler generator.
Diffstat (limited to 'beautifulsoup/element.py')
-rw-r--r-- | beautifulsoup/element.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/beautifulsoup/element.py b/beautifulsoup/element.py index e3144b4..80ab7ba 100644 --- a/beautifulsoup/element.py +++ b/beautifulsoup/element.py @@ -709,7 +709,7 @@ class Tag(PageElement, Entities): same is true of the tag name.""" generator = self.recursive_children if not recursive: - generator = self.childGenerator + generator = self.children return self._find_all(name, attrs, text, limit, generator, **kwargs) # Old names for backwards compatibility. @@ -728,7 +728,8 @@ class Tag(PageElement, Entities): return self.attrMap #Generator methods - def childGenerator(self): + @property + def children(self): for i in range(0, len(self.contents)): yield self.contents[i] raise StopIteration @@ -742,7 +743,11 @@ class Tag(PageElement, Entities): while current is not stopNode: yield current current = current.next - # Old name for backwards compatibility + + # Old names for backwards compatibility + def childGenerator(self): + return self.children + def recursiveChildGenerator(self): return self.recursive_children |