File tree Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -175,28 +175,17 @@ function Base.show(io::IO, x::Py)
175175end
176176
177177function Base. show (io:: IO , :: MIME"text/plain" , o:: Py )
178- hasprefix = get (io, :typeinfo , Any) != Py
179178 if pyisnull (o)
180- if hasprefix
181- printstyled (io, " Python NULL" , bold= true )
182- else
183- print (io, " NULL" )
184- end
185- return
186- elseif pyisnone (o)
187- if hasprefix
188- printstyled (io, " Python None" , bold= true )
189- else
190- print (io, " None" )
191- end
192- return
179+ str = " NULL"
180+ else
181+ str = pyrepr (String, o)
193182 end
194- h, w = displaysize (io)
195- compact = get (io, :compact , false )
196- str = pyrepr (String, o)
183+ hasprefix = (get (io, :typeinfo , Any) != Py):: Bool
184+ compact = get (io, :compact , false ):: Bool
197185 multiline = ' \n ' in str
198- prefix = hasprefix ? compact ? " Py:$(multiline ? ' \n ' : ' ' ) " : " Python $(pytype (o). __name__) :$(multiline ? ' \n ' : ' ' ) " : " "
199- printstyled (io, prefix, bold= true )
186+ prefix = hasprefix ? compact ? " Py:$(multiline ? ' \n ' : ' ' ) " : " Python:$(multiline ? ' \n ' : ' ' ) " : " "
187+ print (io, prefix)
188+ h, w = displaysize (io)
200189 if get (io, :limit , true )
201190 h, w = displaysize (io)
202191 h = max (h- 3 , 5 ) # use 3 fewer lines to allow for the prompt, but always allow at least 5 lines
You can’t perform that action at this time.
0 commit comments