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 734926 - Cannot set __doc__ attribute of GObject sub-classes
Cannot set __doc__ attribute of GObject sub-classes
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-17 00:53 UTC by Simon Feltman
Modified: 2018-01-10 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't mask GObject sub-class doc strings in meta-class (2.31 KB, patch)
2014-08-17 01:04 UTC, Simon Feltman
committed Details | Review
tests: Add failing tests for GObject sub-class doc-strings (2.26 KB, patch)
2014-08-17 01:04 UTC, Simon Feltman
committed Details | Review

Description Simon Feltman 2014-08-17 00:53:29 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
Comment 1 Simon Feltman 2014-08-17 01:04:37 UTC
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
Comment 2 Simon Feltman 2014-08-17 01:04:40 UTC
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
Comment 3 Simon Feltman 2014-08-17 01:04:43 UTC
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 4 Simon Feltman 2014-08-17 01:06:16 UTC
Comment on attachment 283631 [details] [review]
Don't mask GObject sub-class doc strings in meta-class

wrong bug
Comment 5 Simon Feltman 2014-08-17 01:06:40 UTC
Comment on attachment 283632 [details] [review]
tests: Add failing tests for GObject sub-class doc-strings

wrong bug
Comment 6 GNOME Infrastructure Team 2018-01-10 20:44:43 UTC
-- 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.