Skip to content

Commit 06ab661

Browse files
author
Christopher Doris
committed
format python docstrings as code (to preserve formatting)
1 parent 2c90b52 commit 06ab661

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Py.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ function Base.Docs.getdoc(x::Py, @nospecialize(sig))
481481
# docstring
482482
doc = pyimport("inspect").getdoc(x)
483483
if !pyisnone(doc)
484-
push!(parts, Text(pystr_asstring(doc)))
484+
push!(parts, Markdown.Code("text", pystr_asstring(doc)))
485485
end
486486
return Markdown.MD(parts)
487487
end

src/abstract/object.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Equivalent to `hasattr(x, k)` in Python.
3333
3434
Tests if `getattr(x, k)` raises an `AttributeError`.
3535
"""
36-
# pyhasattr(x, k) = errcheck(@autopy x k C.PyObject_HasAttr(getptr(x_), getptr(k_))) == 1
3736
function pyhasattr(x, k)
3837
ptr = @autopy x k C.PyObject_GetAttr(getptr(x_), getptr(k_))
3938
if iserrset(ptr)
@@ -48,6 +47,7 @@ function pyhasattr(x, k)
4847
return true
4948
end
5049
end
50+
# pyhasattr(x, k) = errcheck(@autopy x k C.PyObject_HasAttr(getptr(x_), getptr(k_))) == 1
5151
export pyhasattr
5252

5353
"""

0 commit comments

Comments
 (0)