Skip to content

Commit

Permalink
update help support for JuliaLang/julia#11943
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Aug 4, 2015
1 parent 4e3ff80 commit feb4e24
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/PyCall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export pycall, pyimport, pybuiltin, PyObject,
import Base: size, ndims, similar, copy, getindex, setindex!, stride,
convert, pointer, summary, convert, show, haskey, keys, values,
eltype, get, delete!, empty!, length, isempty, start, done,
next, filter!, hash, splice!, pop!, ==, isequal, help, push!,
next, filter!, hash, splice!, pop!, ==, isequal, push!,
unshift!, shift!, append!, insert!, prepend!, writemime, mimewritable

# Python C API is not interrupt-save. In principle, we should
Expand Down Expand Up @@ -156,8 +156,17 @@ function show(io::IO, o::PyObject)
print(io, "PyObject $(pystring(o))")
end

function help(o::PyObject)
pycall(pybuiltin("help"), PyAny, o)

if VERSION < v"0.4.0-dev+6471"
function Base.help(o::PyObject)
pycall(pybuiltin("help"), PyAny, o)
end
else
function Base.Docs.doc(o::PyObject)
Base.Docs.Text(haskey(o, "__doc__") ?
convert(AbstractString, o["__doc__"]) :
"Python object (no docstring found)")
end
end

#########################################################################
Expand Down

0 comments on commit feb4e24

Please sign in to comment.