pygobject / pygobject-stubs

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

Generating Gtk3 stubs, leads to invalid python #169

Open lovetox opened 9 months ago

lovetox commented 9 months ago

I see this line in the code

xoptions=<flags GTK_EXPAND | GTK_FILL of type Gtk.AttachOptions>

which is not valid python

matperc commented 8 months ago

The fail is here generate.py:491

        signature = str(inspect.signature(function))

This the output from python

>>> str(inspect.signature(Gtk.Table.attach))
'(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions=<flags GTK_EXPAND | GTK_FILL of type Gtk.AttachOptions>, yoptions=<flags GTK_EXPAND | GTK_FILL of type Gtk.AttachOptions>, xpadding=0, ypadding=0)'

I think an override (like it's done right now) it's fine