Meanwhile, I found another division/range combination that could be
problematic. I attached an updated patch.

-- Alexandre

On 6/25/07, Alexandre Vassalotti <[EMAIL PROTECTED]> wrote:
Hi,

I found two small bugs in pydoc.py. The patch is rather simple, so I doubt
I have to explain it. Note, I removed the -*- coding: -*- tag, since
the encoding of pydoc.py is actually utf-8, not Latin-1 (at least, that's
what Emacs told me).

Index: Lib/pydoc.py
===================================================================
--- Lib/pydoc.py	(revision 55848)
+++ Lib/pydoc.py	(working copy)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python
-# -*- coding: Latin-1 -*-
 """Generate Python documentation in HTML or text for interactive use.
 
 In the Python interpreter, do "from pydoc import help" to provide online
@@ -470,7 +469,7 @@
     def multicolumn(self, list, format, cols=4):
         """Format a list of items into a multi-column list."""
         result = ''
-        rows = (len(list)+cols-1)/cols
+        rows = (len(list)+cols-1) // cols
         for col in range(cols):
             result = result + '<td width="%d%%" valign=top>' % (100/cols)
             for i in range(rows*col, rows*col+rows):
@@ -1750,10 +1749,10 @@
 ''' % sys.version[:3])
 
     def list(self, items, columns=4, width=80):
-        items = items[:]
+        items = list(items)
         items.sort()
-        colw = width / columns
-        rows = (len(items) + columns - 1) / columns
+        colw = width // columns
+        rows = (len(items) + columns - 1) // columns
         for row in range(rows):
             for col in range(columns):
                 i = col * rows + row
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to