[Auto Import] Better auto-import priority (Lower the priority of superseded modules) #3328
Replies: 4 comments 2 replies
-
That's why I choose PyCharm... |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
I experience something similar, that I think is also related to auto suggestion logic. Normally when typing Other thing that I found, was that suggestions won't prioritize local packages, I have a package called Maybe it could make sense to have a higher ranking for local objects (local in the sense of the user's project instead of third party libs)? Other option is maybe to keep track of import frequency (objects that were imported a lot have a lower threshold to appear in suggestions)? Besides the deprecated being lower ranked, maybe most commonly used imports (from Github's Python's codebases perhaps) could also be higher ranked? Examples: At last, I also found that quick actions suggestions ( Anyways, just ideas. |
Beta Was this translation helpful? Give feedback.
-
Another auto-import problem that I always face is when I need to import something like |
Beta Was this translation helpful? Give feedback.
-
According to this doc site, lots of modules are superseded / deprecated.
However, lots of them still have high priority and break users' auto-import experience.
For example:
type
from typing imp
and the first entry isimp
module.Option
's auto-import entry is fromoptparse
rather than my local module.And some related annoying imports:
from ctypes import Union
rather thanfrom typing import Union
(alsotyping.cast
)from re import I
(when completingfrom ... import ...
too quickly)I believe the auto-import problem has been lingering for quite a long time.
Is it possible to address a better algorithm (context-aware / prediction based on user data) to improve the state?
If not, could you please add a way for us to filter out those modules we don't want? (For example
this
, from #2535)Beta Was this translation helpful? Give feedback.
All reactions