Skip to content

Commit 65d5afb

Browse files
author
Christopher Doris
committed
show julia using text/plain
1 parent 33264f7 commit 65d5afb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/jlwrap/any.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
const pyjlanytype = pynew()
22

3-
pyjlany_repr(self) = Py("<jl $(repr(self))>")
3+
# pyjlany_repr(self) = Py("<jl $(repr(self))>")
4+
function pyjlany_repr(self)
5+
str = repr(MIME("text/plain"), self; context=IOContext(devnull, :limit=>true, :displaysize=>(23,80)))
6+
# type = self isa Function ? "Function" : self isa Type ? "Type" : nameof(typeof(self))
7+
sep = '\n' in str ? '\n' : ' '
8+
Py("Julia:$sep$str")
9+
end
410

511
# Note: string(self) doesn't always return a String
612
pyjlany_str(self) = Py(sprint(print, self))

0 commit comments

Comments
 (0)