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

wx.DEFAULT, BOLD, NORMAL and other constants are not detected by Pylance from pyi definition #2559

Open
omar-abdelgawad opened this issue Jun 11, 2024 · 0 comments

Comments

@omar-abdelgawad
Copy link

Operating system: Ubuntu 22.04.4 LTS
wxPython version & source: 4.2.1 (pypi)
Python version & source: 3.10 (default version in Ubuntu)

Description of the problem: Some variables are exported from the stubs in a way that the LSP (Pylance in vscode) can't detect. There is no actual runtime problem it is just that something is wrong with the stubs (.pyi files).

Examples include: wx.BOLD, wx.DEFAULT, and wx.LIGHT.
Here is a snippet of my problem:
image

I started investigating the .pyi files for the definition of these variables and found them all in .venv/lib/python3.10/site-packages/wx/core.pyi (I use a virtual environment).
image
If I remove the wx from the definition the issue is fixed.

Code Example (click to expand)
import wx
wx.BOLD  # Pylance thinks this variable is not defined
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

1 participant