Skip to content

Data looks incorrect, causing mypy to create false alarms #6

@genodeftest

Description

@genodeftest

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions