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 688025 - Property instances docstring/blurb does not show up with pydoc
Property instances docstring/blurb does not show up with pydoc
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-10 03:37 UTC by Simon Feltman
Modified: 2012-11-12 06:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use Property getter doc string or explicit blurb for Property instance doc (2.91 KB, patch)
2012-11-10 03:42 UTC, Simon Feltman
committed Details | Review

Description Simon Feltman 2012-11-10 03:37:07 UTC
When using pythons pydoc or help command, Property accessors show the Property classes doc string instead of the instances function/blurb. For example:

from gi.repository import GObject
class Test(GObject.Object):
    @GObject.Property(type=int)
    def foo(self):
        """foo docstring."""
        return 1
    bar = GObject.Property(type=int, blurb='bar docstring.')

Test.bar.__doc__ == GObject.Property.__doc__  # True
Test.foo.__doc__ == GObject.Property.__doc__  # True


The above code shows the Property instances have the same doc string as the Property class which is a rather lengthy and unhelpful. Instances creation should clobber this with the callable getters docstring or explicit blurb.
Comment 1 Simon Feltman 2012-11-10 03:42:46 UTC
Created attachment 228618 [details] [review]
Use Property getter doc string or explicit blurb for Property instance doc

Assign Property getter __doc__ string or explicit blurb parameters
to the Property instances __doc__ attribute. Overrides the default
Property classes lengthy and unhelpful doc string on instances.
Comment 2 Martin Pitt 2012-11-12 06:16:44 UTC
Review of attachment 228618 [details] [review]:

Thanks!