-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
curses
is not available on Windows
#6749
Conversation
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
What about windows-curses? It seems to be compatible with stdlib curses and just installing it on Windows enable me to run python curses code from other platforms just fine (only linter complains about everthing about curses due to the plaform check you have implemented here)… |
I think removing the if statements in typeshed would be the simplest fix. I think we can't release a |
I wasn't aware of (We should add comments to the stub stating why it's not all inside a |
I tried this and couldn't get it to work. I installed mypy and This might not have been a good idea, even if it worked. Presumably the stubs for |
Hi, I just noticed this problem with windows-curses provided curses failing to autocomplete in VS Code. Is there any update on reverting this? Can I send a PR? |
Please do! |
Created #11241 |
I wonder whether it would be possible to have a third-party stub that "takes over" the curses namespace if types-windows-curses get installed? I am a bit uncomfortable about pretending that curses is always available on Windows. |
@Akuli implied that isn't possible at least with Mypy. Also I wonder if there is still some value for having the types available even if the module isn't supported on a platform, for development of apps that will be run in a different environment, e.g. if you use VS Code on Windows to write a script to run in WSL or a Linux VM. (Although VS Code can be attached directly to WSL and use the WSL python interpreter, sometimes that is less convenient). |
If you're using mypy, you can use the platform option to type check as if you have some other value for sys.platform https://mypy.readthedocs.io/en/stable/config_file.html#confval-platform |
It should be as per the typing specs, third-party stubs should be tried before the built-in typeshed stubs:
(Note: The language about third party libraries is outdated.) |
Refs #6734