-
-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
do not show output for assignment? #649
Comments
No. When you evaluate a cell in IJulia, it is just returns the value of the last expression, and what you are seeing here is a difference between the Julia and Python languages. In Python, assignment expressions don't have a value, whereas in Julia the assignment (In IPython, they added support for showing the result of an assignment, but they had to do it by hacking the AST because of the abovementioned Python language behavior: ipython/ipython#10598) |
Wow, I didn't know about the semicolon method, I've just been adding @stevengj I do think this could be a very useful feature, maybe enabled by a configuration option that is disabled by default. I don't think the differences in the two languages are very important here, it's just more about what is most useful/convenient to the user of the notebook. Pretty-printing even small arrays take up a lot of vertical space (one line per element) and make the notebook significantly less readable (which is one of the main selling points of the notebook in the first place) if those values aren't important. Personally I think at least 90% of the time I'm not interested in seeing the value of the assignment at the end of the cell, so it would make a lot of sense to have an option to disable it by default. For the minority of times I do want it I could just do what I do in IPython which very simple:
It seems like this shouldn't be too difficult to add, it looks like there's already a manual check for the semicolon at the end of the line that sets a IJulia.jl/src/execute_request.jl Line 37 in fda9fe5
|
In IPython, something like
x = np.arange(1000)
shows no output, whereas in IJuliax = collect(1:1000)
does. I understand this matches the REPL, but is there a way to surpress this by default other than adding semicolons everywhere?The text was updated successfully, but these errors were encountered: