Conversation
ef16f5f to
faede7c
Compare
|
Hm, 0d14343 causes a regression in GLib.Idle. It correctly removes all methods from that object but it wrongly inherit from GObject.GBoxed instead of the override Source object. The reason is the generator assumes override classes are direct subclass of GI classes, and not sub-subclass. |
faede7c to
602625c
Compare
Fixed. Now GLib.Idle and GLib.Timeout inherit from GLib.Source instead of duplicating all GLib.Source attributes. |
|
@lovetox FYI, I'm also adding typing annotations to glib/gobject overrides: https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/506. |
|
Let's put this on hold, I found an issue that I described in https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/506#note_2652436. @lovetox your optinion on that would be appreciated. |
ff9a10f to
77245ec
Compare
|
Ok, problem solved and typing annotation has been merged in pygobject glib/gobject overrides. This MR is ready to go. |
mypy complains when it has __enter__ but not __exit__.
We should have stubs only for attributes in the current class and not those inherited by base classes.
This is similar to constants, but are type hints for attributes
usually defined in __init__():
```
class Foo:
attr: int
def __init__(self):
self.attr = 42
```
It is defined by GI for GBoxed types, and can also be defined in overrides.
403aa4a to
973d567
Compare
|
@lovetox pygobject 3.55.3 has been released with my fix for |
gpointer (void*) arguments are currently typed as `typing.Optional[None]`. They probably should be `bytes|None` but pygobject is completely broken and those methods are unusable.
|
@lovetox kind reminder to review this PR :) |
We automatically generate an __init__ stub based on all writable properties. This avoid duplicated __init__ definition when overrides has e.g. `def __init__(self, *args, **kwargs)`
|
Thanks, great work ! |
|
@lovetox Thanks, are you planning publishing a release soon? This was the final fixes I needed to get my GStreamer project fully typed :) |
hm, as we merged now the Generic ListModel stuff we need to wait until PyGObject makes a stable release, otherwise we depend with a release on a dev version of PyGObject. |
|
@lovetox I'm not sure which fix is needed in pygobject, 3.55.3 release is up to date with main branch. |
No description provided.