Message61458
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>
> __________________________________ |
|
Date |
User |
Action |
Args |
2008-01-21 22:14:44 | sgala | set | spambayes_score: 0.00165944 -> 0.0016594351 recipients:
+ sgala, georg.brandl |
2008-01-21 22:14:43 | sgala | link | issue1867 messages |
2008-01-21 22:14:42 | sgala | create | |
|