[Python-bugs-list] [ python-Bugs-467331 ] ClassType.doc always None (original) (raw)

noreply@sourceforge.net noreply@sourceforge.net
Tue, 02 Oct 2001 15:22:48 -0700


Bugs item #467331, was opened at 2001-10-02 15:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=467331&group_id=5470

Category: Python Interpreter Core Group: Python 2.2 Status: Open Resolution: None Priority: 5 Submitted By: Tim Peters (tim_one) Assigned to: Guido van Rossum (gvanrossum) Summary: ClassType.doc always None

Initial Comment: The docstring for a new-style class is too hard to dig out:

class C(object): ... "Hi. I'm C's docstring." ... C.doc # no luck getattr(C, "doc") # no luck C.dict['doc'] # bingo "Hi. I'm C's docstring."

Note that in restricted mode, you can't eveb get at C.dict (but we don't want to hide the docstring, right?).

If the cause+cure for this isn't instantly known you, assign it back to me and I'll dig into it.

Note that things like int.doc and file.doc work fine; it appears to be only user-defined types that suffer here.


You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=467331&group_id=5470