You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's your directory structure? I would guess that this is a won't fix from our side, because the import logic probably checks sys.modules first, which loads some modules first.
IMO it's a very very bad idea anyway to overwrite top level builtins. It should be fine to use something like from jedi import _ast though.
This came up when I tried using jedi-vim's goto on a symbol defined in the module. The module itself is from an editable installed package.
It doesn't overwrite the builtin, only shares the name. It's not a top-level module and internally the package is using relative import from ._ast import *. In the following code, the goto-command of jedi-vim will fail for both even though Foo is not defined in a builtin.
When a library uses module names that conflicts with builtins, such as
_ast.py
, the import logic in https://github.com/davidhalter/jedi/blob/master/jedi/inference/compiled/subprocess/functions.py#L139 ends up usingimportlib.machinery.BuiltinImporter
as it appears beforeimportlib.machinery.PathFinder
insys.meta_path
.The text was updated successfully, but these errors were encountered: