*** Lib\inspect.py.23a2 Sun Jan 19 05:21:20 2003 --- Lib\inspect.py Sat Mar 29 09:53:33 2003 *************** *** 78,83 **** --- 78,91 ---- and not isfunction(object) and not isclass(object)) + def isdatadescriptor(object): + """Return true if the object is a data descriptor. + + Data descriptors have both a __get__ and a __set__ attribute. Examples are + properties (defined in Python) and getsets and members (defined in C). + Properties and getsets have __doc__ attributes; members do not.""" + return (hasattr(object, "__set__") and hasattr(object, "__get__")) + def isfunction(object): """Return true if the object is a user-defined function. *** Lib\pydoc.py.23a2 Sat Feb 15 17:12:32 2003 --- Lib\pydoc.py Sat Mar 29 10:10:56 2003 *************** *** 676,682 **** push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) ! if callable(value): doc = getattr(value, "__doc__", None) else: doc = None --- 676,682 ---- push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) ! if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None *************** *** 1071,1077 **** hr.maybe() push(msg) for name, kind, homecls, value in ok: ! if callable(value): doc = getattr(value, "__doc__", None) else: doc = None --- 1071,1077 ---- hr.maybe() push(msg) for name, kind, homecls, value in ok: ! if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None