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.