This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sgala
Recipients georg.brandl, sgala
Date 2008-01-21.22:14:42
SpamBayes Score 0.0016594351
Marked as misclassified No
Message-id <1200953678.32580.140.camel@localhost>
In-reply-to <1200775479.14.0.705254713272.issue1867@psf.upfronthosting.co.za>
Content
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 <report@bugs.python.org>
> <http://bugs.python.org/issue1867>
> __________________________________
History
Date User Action Args
2008-01-21 22:14:44sgalasetspambayes_score: 0.00165944 -> 0.0016594351
recipients: + sgala, georg.brandl
2008-01-21 22:14:43sgalalinkissue1867 messages
2008-01-21 22:14:42sgalacreate