Open jacksonloper opened 9 years ago
I could add a flag, e.g. ijs --ijs-max-output-length=10000
. I could do this straight away. How do you think?
There is also the question whether I should set a maximum length by default.
PS: As a workaround until I change this, you could append an additional statement (e.g. 0 or undefined) to prevent IJavascript from printing x out:
> x = new Float32Array(100000); 0;
0
Reminder to myself: I need to limit not only the output, but also the TAB and shift-TAB requests.
Further thoughts:
util.inspect()
to generate the output representation of an object. By default, util.inspect()
inspects objects up to 2 levels in depth. This means that either new Float32Array(100000)
, [new Float32Array(100000)]
or [[new Float32Array(100000)]]
would hog the kernel.About the second point you make (use of custom printout functions): this is already in my TODO list. I'm planning to allow users define $$mimer$$
, a function that takes an object and returns a custom MIME representation of the object.
On 03/11/15 18:23, Jackson Loper wrote:
1.
Simple max-printout flag like that would be great! Could it possibly be set from within the interpreter, perhaps through some global variable?
Unless this is issue is really urgent to you. I want to provide an initial implementation of $$mimer$$
first.
Mimer sounds awesome. Do that.
If I type this...
...I will regret it :). It will try to print out the entire x. If I could successfully interrupt the kernel without losing most of the variables it wouldn't be such a big deal...
I suppose in the long run you'll need some kind of method like chrome has (e.g. here). To implement you'd need need something like jstree which would call back to node to get info tree branches got opened. And of course you'd have to get jstree into jupyter.
... which is all very good stuff for the long term, but I suspect it's not you guys' highest priority :).
In the short term, is there any easy way to truncate printouts on any object which has too many members?