pygobject-stubs
pygobject-stubs copied to clipboard
PEP 561 Typing Stubs for PyGObject
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....
Based on the work in #167, we can extract documentation for functions and function arguments. TODO: - [ ] Add docstring to `__init__()` for classes - [x] Fix wrapped functions...
The messages cannot be more specific AFAIK Closes #165
[Nix](https://nixos.org/) package manager makes it easy to obtain all the typelibs without having to install them globally. Just run `nix-shell` (or enter the project directory if you have [direnv](https://direnv.net/)) and...
~Blocked by this bug https://github.com/python/mypy/issues/15177~ Closes #144 Closes #149
I see this line in the code `xoptions=` which is not valid python
There is now [PEP 702 – Marking deprecations using the type system](https://peps.python.org/pep-0702/), which might be useful for updating deprecated code.
user_data is obviously meant for the programmer to put arbitrary data in for later use. At runtime it may be any type. However, user_data is typed as None throughout these...
Here is a simple example: ```python from gi.repository import GLib parser = GLib.option.OptionParser(option_list=[ GLib.option.make_option('--flag', action='store_true', help='flag'), ]) parser.parse_args() print('flag is', parser.values.flag) ``` mypy complains about type errors: ``` $ mypy...