Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
genodeftest opened this issue Jan 24, 2020 · 4 comments
Closed

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

genodeftest opened this issue Jan 24, 2020 · 4 comments

Comments

@genodeftest
Copy link

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?

@genodeftest
Copy link
Author

Or is this project officially dead together with https://github.com/pygobject/pgi?

@genodeftest
Copy link
Author

Would you be interested in a rework based on fakegir?

@lazka
Copy link
Member

lazka commented Jan 25, 2020

Hey, yes, in the current state this package isn't really useful.

There is work to improve things here: pygobject/pgi-docgen#176

@lovetox
Copy link
Collaborator

lovetox commented Jan 3, 2022

This should be fixed now since 055b9ef

@lovetox lovetox closed this as completed Jan 3, 2022
CharlieQLe pushed a commit to CharlieQLe/pygobject-stubs that referenced this issue Dec 19, 2022
# This is the 1st commit message:

other: Reformat codebase with black

# This is the commit message #2:

Add Adw

# This is the commit message #3:

Add types for functions

# This is the commit message pygobject#4:

Add types for ActionRow

# This is the commit message pygobject#5:

Add types for Adw.Animation

# This is the commit message pygobject#6:

Add types for Adw.Application

# This is the commit message pygobject#7:

Add types for Adw.ApplicationWindow

# This is the commit message pygobject#8:

Update Gdk to 4.0

# This is the commit message pygobject#9:

Move Gdk into correct location

# This is the commit message pygobject#10:

Add types for Adw.Avatar

# This is the commit message pygobject#11:

Add types for Adw

# This is the commit message pygobject#12:

Removed Typing import

# This is the commit message pygobject#13:

Add types for Adw
CharlieQLe added a commit to CharlieQLe/pygobject-stubs that referenced this issue Dec 19, 2022
# This is the 1st commit message:

other: Reformat codebase with black

# This is the commit message #2:

Add Adw

# This is the commit message #3:

Add types for functions

# This is the commit message pygobject#4:

Add types for ActionRow

# This is the commit message pygobject#5:

Add types for Adw.Animation

# This is the commit message pygobject#6:

Add types for Adw.Application

# This is the commit message pygobject#7:

Add types for Adw.ApplicationWindow

# This is the commit message pygobject#8:

Update Gdk to 4.0

# This is the commit message pygobject#9:

Move Gdk into correct location

# This is the commit message pygobject#10:

Add types for Adw.Avatar

# This is the commit message pygobject#11:

Add types for Adw

# This is the commit message pygobject#12:

Removed Typing import

# This is the commit message pygobject#13:

Add types for Adw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants