GNOME Bugzilla – Bug 688025
Property instances docstring/blurb does not show up with pydoc
Last modified: 2012-11-12 06:51:18 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.
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.
Review of attachment 228618 [details] [review]: Thanks!