0

I have this snippet of Python code. In the Case A, I don't get the doc string, but in the Case B, I get it.

Please advise me to get it to work in the Case A. Thanks.

from jedi import Script, Interpreter
import math

# Case A
completions = Interpreter(source="math.sin(0)", line=1, column=7, namespaces=[{'math': math}]).completions()
for x in completions:
    print(x.docstring())  # Bad. The doc string is always empty.

# Case B
completions = Script(source='import math\nmath.sin(0)', line=2, column=7).completions()
for x in completions:
    print(x.docstring())  # Good. Got the doc string.
Developer
  • 31
  • 5
  • I'm currently reworking the Interpreter completions, because there's a lot of issues with it. Get back to me in two months! – Dave Halter Jun 15 '16 at 20:09

1 Answers1

1

This has been fixed a few weeks ago! Just checkout the current dev branch.

It will probably be released to PyPi in one or two months.

Dave Halter
  • 15,556
  • 13
  • 76
  • 103