GNOME Bugzilla – Bug 734926
Cannot set __doc__ attribute of GObject sub-classes
Last modified: 2018-01-10 20:44:43 UTC
Not a huge problem but this should be possible: from gi.repository import GObject class Spam(GObject.Object): pass Spam.__doc__ = 'eggs' AttributeError: can't set attribute
Committed a variation of the only generates doc strings for classes comming from gi.repository or gi.overrides (constructor docs don't make sense for sub-classes with or without a doc string). Also created a ticket (bug 734926) and added a failing test. The following fixes have been pushed: 7076669 Don't mask GObject sub-class doc strings in meta-class 4cdca43 tests: Add failing tests for GObject sub-class doc-strings
Created attachment 283631 [details] [review] Don't mask GObject sub-class doc strings in meta-class If a class has a __doc__ attribute explicitly set, always return it. Only generate doc strings for classes coming from gi.repository or gi.overrides. Co-Authored-By: Simon Feltman <sfeltman@src.gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=731452
Created attachment 283632 [details] [review] tests: Add failing tests for GObject sub-class doc-strings Add tests for sub-class docstrings set with either doc-string syntax and by setting the __doc__ attribute directly. Co-Authored-By: Simon Feltman <sfeltman@src.gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=731452
Comment on attachment 283631 [details] [review] Don't mask GObject sub-class doc strings in meta-class wrong bug
Comment on attachment 283632 [details] [review] tests: Add failing tests for GObject sub-class doc-strings wrong bug
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/78.