mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
#11182: remove the unused and undocumented pydoc.Scanner class. Patch by Martin Morrison.
This commit is contained in:
parent
f476405503
commit
72b8502992
3 changed files with 4 additions and 24 deletions
24
Lib/pydoc.py
24
Lib/pydoc.py
|
@ -1984,30 +1984,6 @@ for modules whose name or summary contain the string "spam".
|
||||||
|
|
||||||
help = Helper()
|
help = Helper()
|
||||||
|
|
||||||
class Scanner:
|
|
||||||
"""A generic tree iterator."""
|
|
||||||
def __init__(self, roots, children, descendp):
|
|
||||||
self.roots = roots[:]
|
|
||||||
self.state = []
|
|
||||||
self.children = children
|
|
||||||
self.descendp = descendp
|
|
||||||
|
|
||||||
def next(self):
|
|
||||||
if not self.state:
|
|
||||||
if not self.roots:
|
|
||||||
return None
|
|
||||||
root = self.roots.pop(0)
|
|
||||||
self.state = [(root, self.children(root))]
|
|
||||||
node, children = self.state[-1]
|
|
||||||
if not children:
|
|
||||||
self.state.pop()
|
|
||||||
return self.next()
|
|
||||||
child = children.pop(0)
|
|
||||||
if self.descendp(child):
|
|
||||||
self.state.append((child, self.children(child)))
|
|
||||||
return child
|
|
||||||
|
|
||||||
|
|
||||||
class ModuleScanner:
|
class ModuleScanner:
|
||||||
"""An interruptible scanner that searches module synopses."""
|
"""An interruptible scanner that searches module synopses."""
|
||||||
|
|
||||||
|
|
|
@ -848,6 +848,7 @@ Ross Moore
|
||||||
Ben Morgan
|
Ben Morgan
|
||||||
Derek Morr
|
Derek Morr
|
||||||
James A Morrison
|
James A Morrison
|
||||||
|
Martin Morrison
|
||||||
Derek McTavish Mounce
|
Derek McTavish Mounce
|
||||||
Alessandro Moura
|
Alessandro Moura
|
||||||
Pablo Mouzo
|
Pablo Mouzo
|
||||||
|
|
|
@ -45,6 +45,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #11182: remove the unused and undocumented pydoc.Scanner class.
|
||||||
|
Patch by Martin Morrison.
|
||||||
|
|
||||||
- Issue #17741: Add ElementTree.IncrementalParser, an event-driven parser
|
- Issue #17741: Add ElementTree.IncrementalParser, an event-driven parser
|
||||||
for non-blocking applications.
|
for non-blocking applications.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue