Take this valid peace of python code:
#!/usr/bin/python3
from gi.repository import GObject
foo = GObject.ParamFlags.READWRITE
print(foo)
With pygobject-stubs installed, mypy throws this error:
error: "Type[ParamFlags]" has no attribute "READWRITE" [attr-defined]
foo = GObject.ParamFlags.READWRITE
Which is expected when having a look at the code: The GObject.pyi file does have a ParamFlags
attribute, but that does not have a READWRITE
attribute. Instead READWRITE
is an attribute to GObject. The same issue is true for each and everything in all the .pyi files. Is this by intention? Is it expected to be incompatible to mypy?