{"library":"pygobject-stubs","title":"PyGObject Stubs","description":"Typing stubs for PyGObject, providing type hints for GLib, GObject, Gtk, Gdk, Gio, and other GNOME libraries. Version 2.17.0 supports Python >=3.10. This package enables static type checking (mypy, pyright) for PyGObject code and is actively maintained alongside PyGObject releases. Release cadence is irregular, tied to GNOME releases and bug fixes.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pygobject-stubs","pip install 'pygobject-stubs>=2.17.0'"],"cli":null},"imports":["from gi.repository import Gtk; win = Gtk.Window()","from gi.repository import GLib; loop = GLib.MainLoop()"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from gi.repository import Gtk, Gio\n\n# Attempt to get the default display (succeeds only if running under X11/Wayland)\ndisplay = Gdk.Display.get_default()\nif display is None:\n    raise RuntimeError('No display available: ensure DISPLAY or WAYLAND_DISPLAY is set')\n# Example: create a simple window (won't show without main loop; just for type-checking)\nwin = Gtk.Window.new(Gtk.WindowType.TOPLEVEL)\nwin.set_default_size(200, 200)\nwin.show_all()\n# Type-check with mypy: mypy --enable-incomplete-feature=GenericParenTypeHints script.py","lang":"python","description":"Quickstart example showing correct import pattern and basic usage for type-checking.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}