pygobject / pygobject-stubs

PEP 561 Typing Stubs for PyGObject
GNU Lesser General Public License v2.1
74 stars 26 forks source link

Methods of `Gtk.WidgetClass` that also exist on `Gtk.Widget` can not be used as class methods. #184

Open theCapypara opened 7 months ago

theCapypara commented 7 months ago

Trying to call a Gtk.WidgetClass class method on something like Gtk.TextView raises a type error, because the generated typestubs make something like Gtk.WidgetClass.add_shortcut a method of Gtk.TextView, which is semi-correct. It's both a method on Gtk.Widget but also a class method of Gtk.WidgetClass which type[Gtk.TextView] should implement.

I haven't 100% checked if this a general incompatibility with Gtk.WidgetClass.