summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-01-29 06:37:52 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-01-29 06:37:52 (GMT)
commit756b3f3c15bd314ffa25299ca25465ae21e62a30 (patch)
treef504d3ab53c151b7e88ebfebd069a034f80f5025 /Lib/pydoc.py
parent141d4e564314abde44189eb5e3a9f509dab045ff (diff)
downloadcpython-756b3f3c15bd314ffa25299ca25465ae21e62a30.zip
cpython-756b3f3c15bd314ffa25299ca25465ae21e62a30.tar.gz
cpython-756b3f3c15bd314ffa25299ca25465ae21e62a30.tar.bz2
* Move collections.deque() in from the sandbox
* Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index e53aa16..e6b53c1 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -55,6 +55,7 @@ Mynd you, møøse bites Kan be pretty nasti..."""
import sys, imp, os, re, types, inspect, __builtin__
from repr import Repr
from string import expandtabs, find, join, lower, split, strip, rfind, rstrip
+from collections import deque
# --------------------------------------------------------- common routines
@@ -685,7 +686,7 @@ class HTMLDoc(Doc):
hr = HorizontalRule()
# List the mro, if non-trivial.
- mro = list(inspect.getmro(object))
+ mro = deque(inspect.getmro(object))
if len(mro) > 2:
hr.maybe()
push('<dl><dt>Method resolution order:</dt>\n')
@@ -763,7 +764,7 @@ class HTMLDoc(Doc):
while attrs:
if mro:
- thisclass = mro.pop(0)
+ thisclass = mro.popleft()
else:
thisclass = attrs[0][2]
attrs, inherited = _split_list(attrs, lambda t: t[2] is thisclass)
@@ -1083,7 +1084,7 @@ class TextDoc(Doc):
push = contents.append
# List the mro, if non-trivial.
- mro = list(inspect.getmro(object))
+ mro = deque(inspect.getmro(object))
if len(mro) > 2:
push("Method resolution order:")
for base in mro:
@@ -1152,7 +1153,7 @@ class TextDoc(Doc):
inspect.classify_class_attrs(object))
while attrs:
if mro:
- thisclass = mro.pop(0)
+ thisclass = mro.popleft()
else:
thisclass = attrs[0][2]
attrs, inherited = _split_list(attrs, lambda t: t[2] is thisclass)