Santiago Gala added the comment:

El sáb, 19-01-2008 a las 20:44 +0000, Georg Brandl escribió:
> Georg Brandl added the comment:
> 
> Fixed in r60100.
> 

If the problem with the output of filter is solved at the call site I'd
suggest the second hunk of:

$ svn diff Lib/pydoc.py
Index: Lib/pydoc.py
===================================================================
--- Lib/pydoc.py        (revisión: 60126)
+++ Lib/pydoc.py        (copia de trabajo)
@@ -1192,7 +1192,7 @@
             else:
                 tag = "inherited from %s" % classname(thisclass,

object.__module__)
-            filter(lambda t: not t[0].startswith('_'), attrs)
+            #filter(lambda t: not t[0].startswith('_'), attrs)

             # Sort attrs by name.
             attrs.sort()
@@ -1972,9 +1972,8 @@
 '#ffffff', '#7799ee')
                 def bltinlink(name):
                     return '<a href="%s.html">%s</a>' % (name, name)
-                names = filter(lambda x: x != '__main__',
-                               sys.builtin_module_names)
-                contents = html.multicolumn(list(names), bltinlink)
+                names = [x for x in sys.builtin_module_names if x !=
'__main__']
+                contents = html.multicolumn(names, bltinlink)
                 indices = ['<p>' + html.bigsection(
                     'Built-in Modules', '#ffffff', '#ee77aa',
contents)]

instead, i.e. use a simple list comprehension instead of the filter
expression (ugly) and list(names). The first hunk removes a useles
expression, I'm not sure why it is there, but filter has no side
effects. It looks like attrs = filter... is intended, but then, again a
list comprehension would be clearer.

Regards
Santiago

> ----------
> nosy: +georg.brandl
> resolution:  -> fixed
> status: open -> closed
> 
> __________________________________
> Tracker <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue1867>
> __________________________________

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1867>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to