summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index e4074dca9a..45943334dd 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1748,17 +1748,16 @@ such as "spam", type "modules spam".
''' % sys.version[:3])
def list(self, items, columns=4, width=80):
- items = items[:]
- items.sort()
- colw = width / columns
- rows = (len(items) + columns - 1) / columns
+ items = list(sorted(items))
+ colw = width // columns
+ rows = (len(items) + columns - 1) // columns
for row in range(rows):
for col in range(columns):
i = col * rows + row
if i < len(items):
self.output.write(items[i])
if col < columns - 1:
- self.output.write(' ' + ' ' * (colw-1 - len(items[i])))
+ self.output.write(' ' + ' ' * (colw - 1 - len(items[i])))
self.output.write('\n')
def listkeywords(self):