Merge lp://qastaging/~mszamot-gmail/beautifulsoup/beautifulsoup into lp://qastaging/beautifulsoup
Proposed by
Marcin Szamotulski
Status: | Needs review |
---|---|
Proposed branch: | lp://qastaging/~mszamot-gmail/beautifulsoup/beautifulsoup |
Merge into: | lp://qastaging/beautifulsoup |
Diff against target: |
316 lines (+222/-23) 2 files modified
bs4/element.py (+78/-23) bs4/tests/test_soup.py (+144/-0) |
To merge this branch: | bzr merge lp://qastaging/~mszamot-gmail/beautifulsoup/beautifulsoup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leonard Richardson | Pending | ||
Review via email: mp+166933@code.qastaging.launchpad.net |
Commit message
Make Tag.descendants a proper generator. Make possible to resume iteration at a given node, which is important when one replaces nodes.
Description of the change
Make Tag.descendants a proper generator. With this patch one can send back where iteration should resume. This important if one replaces nodes with Tag.replace_with() method. See the doc string for an example.
To post a comment you must log in.
Unmerged revisions
- 307. By Marcin Szamotulski
-
Added proper generators and tests: Tag.next_elements, Tag.previous_
elements,
Tag.next_siblings, Tag.previous_siblings, Tag.parents. - 306. By Marcin Szamotulski
-
Add a test for Tag.descendants generator
- 305. By Marcin Szamotulski
-
Make descendants a proper generator. This makes possible to resume iteration
at a given node, which is important when one replaces nodes.
Quick questions:
1. Can you write some tests for this? Turning your docstring example into a test would be a good start.
2. Do you want to do this for the other generators as well?