New submission from Milko Krachounov <pyt...@milko.3mhz.net>: If I make a class B, and add staticmethod(A) as an attribute when B is another class, help(B) breaks. The issue appears with Python 2.6.6, trunk, 3.1.3c1, and py3k SVN.
Python 2.7 (trunk:86836, Nov 27 2010, 18:23:07) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class A(object): ... pass ... >>> class B(object): ... attr = staticmethod(A) ... >>> help(B) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/milko/Среда/Python/trunk/Lib/site.py", line 453, in __call__ return pydoc.help(*args, **kwds) File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 1720, in __call__ self.help(request) File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 1767, in help else: doc(request, 'Help on %s:') File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 1508, in doc pager(render_doc(thing, title, forceload)) File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 1503, in render_doc return title % desc + '\n\n' + text.document(object, name) File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 327, in document if inspect.isclass(object): return self.docclass(*args) File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 1216, in docclass lambda t: t[1] == 'static method') File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 1162, in spill name, mod, object)) File "/home/milko/Среда/Python/trunk/Lib/pydoc.py", line 327, in document if inspect.isclass(object): return self.docclass(*args) TypeError: docclass() takes at most 4 arguments (5 given) Python 3.2a4+ (py3k:86836, Nov 27 2010, 18:35:01) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... pass ... >>> class B: ... attr = staticmethod(A) ... >>> help(B) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/milko/Среда/Python/py3k/Lib/site.py", line 447, in __call__ return pydoc.help(*args, **kwds) File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 1713, in __call__ self.help(request) File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 1760, in help else: doc(request, 'Help on %s:') File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 1504, in doc pager(render_doc(thing, title, forceload)) File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 1499, in render_doc return title % desc + '\n\n' + text.document(object, name) File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 319, in document if inspect.isclass(object): return self.docclass(*args) File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 1214, in docclass lambda t: t[1] == 'static method') File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 1159, in spill name, mod, object)) File "/home/milko/Среда/Python/py3k/Lib/pydoc.py", line 319, in document if inspect.isclass(object): return self.docclass(*args) TypeError: docclass() takes at most 4 positional arguments (5 given) ---------- components: Library (Lib) messages: 122535 nosy: milko.krachounov priority: normal severity: normal status: open title: help(cls1) breaks when cls1 has staticmethod(cls2) attribute versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10549> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com