After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 69243 - doc strings
doc strings
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: codegen
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2002-01-21 08:04 UTC by James Henstridge
Modified: 2008-07-16 10:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description James Henstridge 2002-01-21 08:05:00 UTC
code generator should do doc strings for functions, methods and maybe even
classes.  This makes the builtin help() system in python useful.  Skip
provided a patch to do this a while back (that produced simple doc strings
listing the argument names and return type), but it may need reworking for
current versions.

We could probably create a special descriptor for GObject.__doc__ that
would expand to some class documentation, possibly including inheritance,
signal docs and property docs.  This would make help('classname')
particularly useful.  (maybe this second bit should be a separate bug?)
Comment 1 James Henstridge 2002-01-23 03:05:52 UTC
Hmm.  Looks like setting __doc__ in the type's __dict__ doesn't do
anything.  Getting class.__doc__ goes through the type.__doc__
property which looks in tp_doc only.

Getting instance.__doc__ works fine though, going through the
descriptor.  Maybe this should be a python bug?
Comment 2 James Henstridge 2002-01-23 15:13:41 UTC
__doc__ descriptor implemented.  __gdoc__ as a synonym (due to
problems listed previously).  The __doc__ descriptor bug has been
reported at:
 
http://sourceforge.net/tracker/index.php?func=detail&aid=507394&group_id=5470&atid=105470
Comment 3 James Henstridge 2002-01-28 02:49:40 UTC
I wrote a patch for python that fixes the above problem at:
  http://www.daa.com.au/~james/files/type-doc.patch

It is appended to this Python bug report on SF:
 
http://sourceforge.net/tracker/index.php?func=detail&aid=504343&group_id=5470&atid=105470

PyGTK has been patched to work with this patch, which means that
help('gtk.Widget') will give signal and property documentation!
Comment 4 James Henstridge 2002-02-25 16:43:11 UTC
The PyTypeType __doc__ property patch got committed to both the head
and the 2.2 maintenance branch, so the nice doc descriptor feature
will work with Python 2.2.1 and 2.3.

woo hoo!
Comment 5 James Henstridge 2002-04-24 05:32:50 UTC
Looks like 2.2.1 doesn't handle eg. gtk.Widget.__doc__ correctly. 
Filed a bug, and a patch has now been applied.  So it should be fixed
for 2.2.2 and 2.3 :)

Still need to look at function doc strings.  Wonder if we could use
descriptors to load their doc strings from an external source (I don't
really feel like loading the complete gtk reference documentation into
core on the off chance that someone will use help()).  If not
possible, simple doc strings giving argument names should be included.
Comment 6 James Henstridge 2002-11-20 13:41:46 UTC
mass reassign of open pygtk and gnome-python bugs.
Comment 7 Christian Reis (not reading bugmail) 2004-02-29 00:35:19 UTC
James, if you plan on working on this, please reassign back to
yourself? Thanks.
Comment 8 Gustavo Carneiro 2006-04-01 20:25:34 UTC
I think this is fixed already.