Questions tagged [python-jedi]

Jedi is an autocompletion library for Python.

From the Jedi website:

Jedi is an autocompletion tool for Python that can be used in IDEs/editors. Jedi works. Jedi is fast. It understands all of the basic Python syntax elements including many builtin functions.

Additionaly, Jedi suports two different goto functions and has support for renaming as well as Pydoc support and some other IDE features.

To use Jedi, the library must be installed. Most users also install an editor plugin.

Plugins exist for Vim, Emacs, Sublime Text, and SynWrite.

53 questions
27
votes
2 answers

Which is more efficient: Python docstrings or type-hints?

I want to add some support for auto-completion to my Python code with Jedi. This can be done by using either function docstrings or type hints (or both). def function_with_types_in_docstring(param1, param2): """Example function with types…
planetp
  • 14,248
  • 20
  • 86
  • 160
18
votes
1 answer

VS Code Python doesn't recognize match statement

When I use a match-case statement in Python in VS Code, it gives red squiggly lines and errors in the "problems" tab:
Tuor
  • 875
  • 1
  • 8
  • 32
14
votes
3 answers

Runaway Jedi Language task in VSCode

Every time I close VSCode (after running some Python script) I have a Python task that lingers in my terminal running 90-100% CPU on my M1 MacBook Air, and I have to manually kill it every time. I ran the following on the PID: ps aux | grep…
JD2775
  • 3,658
  • 7
  • 30
  • 52
10
votes
1 answer

python jedi: how to retrieve methods of instances?

I built simple text editor with some accessibility feature for screen reading software. I'm using Python for .NET (pythonnet) to show a form containing a rich text box. When user press tab after a period it pop-ups a context menu with completions…
Germano Carella
  • 473
  • 6
  • 14
10
votes
5 answers

Can't get the jedi-vim plugin to work

I'm trying to use the jedi-vim plugin for Python autocompletion but I can't get it to work. I have Vim 7.3, and here's what I did: 1- clone the code from git clone http://github.com/davidhalter/jedi-vim path/to/bundles/jedi-vim 2- copy…
jul
  • 36,404
  • 64
  • 191
  • 318
9
votes
2 answers

emacs-jedi does not find numpy completions

I installed emacs-jedi to get some code completion for python in emacs. In general, I must say that I am very impressed! It works well out of the box and finds completions quickly for built -in libraries. However, I use python for scientific…
mike
  • 91
  • 1
  • 2
8
votes
2 answers

Auto import modules with emacs-jedi

With ropemacs you can do something like this: M-x rope-auto-import This analyze the code (I presume) and imports missing modules, for example if I write: datetime.now() it should do the import for me by add this line: from datetime import…
qed
  • 22,298
  • 21
  • 125
  • 196
6
votes
1 answer

Can virtualenvs be made to fall back to user packages instead of system packages?

I use Jedi for Python autocompletion in Emacs, but it's not a dependency of my code so I don't want to put it in my requirements.txt. (Other developers may not use a Jedi editor plugin, and it's certainly not needed when I deploy to Heroku.) But…
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
5
votes
3 answers

Turn Off All automatic code complete in Jedi-Vim

I am trying to use python-jedi in vim but at the moment its completely unusable because it tries to code complete at odd times. I added the following line: let g:jedi#popup_on_dot = 0 to my vimrc file and that has indeed stopped autocomplete on…
chrispepper1989
  • 2,100
  • 2
  • 23
  • 48
5
votes
1 answer

Vim supertab and jedi-vim

Posting as a follow up to How to check if SuperTab and jedi-vim is activated? and have done what Ingo Karkat proposed. Now I wonder what is broken and how I fix it. Here is the output: :verbose imap i SuperTabForward …
JDW
  • 175
  • 3
  • 12
4
votes
1 answer

Jedi - Python autocompletions (hints) not showing methods or suggestions

I'm currently working on Sublime Text 3 using Jedi - Python autocompletions and it works with most basic things. However I use it like in this case with BeautifulSoup4 The main issue is not displaying properly completions for when doing multiple dot…
innicoder
  • 2,612
  • 3
  • 14
  • 29
3
votes
1 answer

Is there a scope analyzer for Python?

Given a python file, I want to find out all of the scopes and declarations for the identifiers in the file. For example, given this file: import a from b import xyz def my_func(g): print "2" my_func(0) a.function_in_a(3) xyz(4) I want the…
oxuser
  • 1,257
  • 2
  • 16
  • 23
2
votes
0 answers

pylsp can't find installed editable packages

The problem is fairly straightforward: pylsp can't deal with editable packages. To create an environment that reproduces my problem: $ mkdir /tmp/pyslp_test $ cd /tmp/pylsp_test $ echo "import jaxtyping" > script.py $ mkdir editable_packages $ git…
2
votes
0 answers

Finding Python base classes with static analysis and Jedi

Note: I don't consider this a duplicate of questions such as List all base classes in a hierarchy of given class?, because I don't have the ability to instantiate classes at run-time. The focus here is on static analysis, not dynamic. I'm using the…
Lemur
  • 442
  • 6
  • 11
2
votes
1 answer

Implementing a lazy property that Jedi can understand

I've been using the lazy-property library (https://pypi.org/project/lazy-property/) for a while. It works perfectly, but in my editor these lazy properties don't give any autocompletions. My setup is Atom, using the ide-python package…
matthewgdv
  • 709
  • 6
  • 14
1
2 3 4