shift + tab python function signature
- Lingua principale
- Julia
- Stelle
- 1.5k
- Fork
- 186
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
This was something I was missing when working with my python code, specifically interactively in the Jupyter notebook.
I don't know how to implement this in a safe way so I'll propose it here as an enhancement. Basically, on shift + tab we should grab the python function signature like IPython does in the Jupyter Notebook.
```julia
@pyimport IPython.core.oinspect as oinspect
function pyobjsignature(o::PyObject)
s = oinspect.signature(o)[:__str__]()
if haskey(o, "__name__")
s = string(o["__name__"][:__str__](), s)
else
s = string("function_call -> ", s)
end
if haskey(o, "__doc__")
d = o[:__doc__]
end
if typeof(d) <: AbstractString
return Base.Docs.Text(join([s, convert(AbstractString, d)], "\n"))
else
return Base.Docs.Text(join([s, "No Python Docstring"], "\n"))
end
end
Base.Docs.getdoc(o::PyObject) = pyobjsignature(o)
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.