-
Notifications
You must be signed in to change notification settings - Fork 29
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
Hide output on assignment #312
Conversation
In my case, if I don't want it to output, I often put a |
I have a plan to implement the output prevention by putting single semicolon at the end of the cell. It is the same behavior as IJulia. |
I found a very interesting issue on IJulia, the kernel of the Julia language.
In Python and R, assignment expressions do not have a value, but in Julia and Ruby, assignment expressions have a value, so it is more natural to show the value.However, even in the Julia language, there seems to be an argument that the output should be hidden for usability. I was thinking of merging this pull request, but after seeing Julia's policy, I decided to put it on hold again. |
By the way, I want to merge this if this behavior can be opt-in by a configuration like below.
@ankane Could you make this configurable? The default configuration should be disable for compatibility. |
I agree with the semicolon! |
In Julia and Ruby, an assignment is an expression so it has a value, whereas an assignment in Python isn't an expression but a statement so it doesn't have a value. |
Added an option and made it opt-in. |
@ankane Thank you so much! |
Hi, this PR hides output on assignment (like Python). This avoids the need to add
; nil
to lines. It uses assignment_expression? from IRB and checks that it exists first for older versions (added in ruby/irb@0a3a0f5).Ref: #195