I see. And I guess pulling in the docs from the associated gir files by default would kind of defeat the purpose of having typelibs in the first place, wouldn't it? What about doing it in IntrospectionModule.__dir__? That only gets called if the dir() built-in is invoked which happens to be what pydoc does to get the members of a module. Then again the __doc__ attribute of anything in the namespace would vary depending on whether dir() was invoked on the module before or not. How about only setting the __doc__ attribute when it is actually accessed?
This looks like it might be a bug with how the dynamic introspection module is appearing to pydoc. Please log it here: https://bugzilla.gnome.org/enter_bug.cgi?product=pygobjectDone, report + patch here: https://bugzilla.gnome.org/show_bug.cgi?id=693839.
Optional arguments are currently not supported because there is no way to get defaults from the introspection API. See: https://bugzilla.gnome.org/show_bug.cgi?id=558620-SimonI came across this discussion on the pygtk mailing list dating back to 2011 which mentions a plan to store a serialized version of the default argument in typelibs: http://www.daa.com.au/pipermail/pygtk/2011-March/019489.html What happened to this idea?