-
Notifications
You must be signed in to change notification settings - Fork 768
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
Import suggestion should suggest collections.abc instead of typing for container types #4738
Comments
Thanks for the suggestion. I suppose the downside is that these container types may eventually be removed from typing. |
It's unlikely these container types will ever be removed from typing. There's no significant upside to removing them (since they're just re-exports), and the downside would be huge because it would impact so much existing code. |
We need to investigate why the collections.abc is not being suggested. |
Let me know if I could help you in any way. But I assume this issue happens to everyone, because I don't think I use any non-standard configuration other than being switched to a venv created by poetry. |
This feels like a possible duplicate of #3318 ? |
Where do you take this from? Core development guidelines or personal feelings about it? Because I don’t think everyone feels that way, so if there’s nothing confirming this, I doubt it’s the case: “Deprecated” means “will be removed at some point” in every single project I ever saw it being defined, except for “never break userspace” Linux. I can imagine there’s a handful more projects like that. Python is not one of them.
Same for me. Either this or #3318 should therefore stay open until this is actually fixed. |
I was just about to report this issue. I'm using Ruff in almost all of my projects, and Ruff has a rule to flag importing deprecated symbols from typing. So now using the import quick fix is a two step operation, have VS Code generate the import, and then have Ruff fix it. ;) |
Container types (e.g.
Iterable
,Collection
, ...) in thetyping
module are deprecated since python 3.9 (see PEP 585). These symbols should be getting imported fromcollections.abc
instead, but the python extension keeps suggesting importing them from thetyping
module.The text was updated successfully, but these errors were encountered: