Skip to content
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

inconsistencies between the terminal version and the notebook #9048

Open
zimmermann6 opened this issue May 25, 2010 · 8 comments
Open

inconsistencies between the terminal version and the notebook #9048

zimmermann6 opened this issue May 25, 2010 · 8 comments

Comments

@zimmermann6
Copy link

In the text version of Sage, var('x'); does not print anything.
However, in the notebook, it prints x, even with the ;
that should prevent output. This is quite annoying. Is there a reason for that?

Also, automatic_names does not work in the terminal version.

CC: eocansey@risc.jku.at

Component: notebook

Issue created by migration from https://trac.sagemath.org/ticket/9048

@jasongrout
Copy link
Member

comment:1

Changed the title to identify the underlying issue. Note that 1+2; also prints out something in the notebook, but not in the command line.

My guess is that it is a convention in ipython, since a semicolon does nothing in just plain python:

% sage -python
Python 2.6.4 (r264:75706, May  6 2010, 23:38:46) 
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2;
3


@jasongrout jasongrout changed the title different behaviour of var in notebook and text version semicolon does not suppress output in the notebook May 26, 2010
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@zimmermann6
Copy link
Author

comment:3

note sure what to do with this ticket. At least we can try to list all inconsistencies between the terminal version and the notebook:

  • 1+2; does not print anything in the terminal version, but does print something in the notebook

  • __ and ____ do not work in the notebook

  • automatic_names does not work in the terminal version

Are there any other differences?

Paul

@zimmermann6 zimmermann6 changed the title semicolon does not suppress output in the notebook inconsistencies between the terminal version and the notebook Aug 24, 2013
@nbruin
Copy link
Contributor

nbruin commented Aug 24, 2013

comment:4

Replying to @zimmermann6:

  • 1+2; does not print anything in the terminal version, but does print something in the notebook

The printing in the notebook is a little more different than just that:

1;2;

prints

1
2

whereas

1
2

prints

2

and

(1
)

prints nothing, whereas

(1)

prints

1

i.e., it seems that all results from statements contained entirely on the last line of the cell are printed, regardless of semicolons, and no other results are. To me this seems a little arbitrary, but resolving this is probably something for the notebook.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@zimmermann6
Copy link
Author

comment:8

I've added automatic_names in the description as a reminder, since we write in our book about Sage (which is currently being translated to english) that automatic_names does not work in the terminal version.

@zimmermann6

This comment has been minimized.

@embray
Copy link
Contributor

embray commented Jul 14, 2019

comment:9

automatic_names also doesn't work in the Jupyter Notebook. This was also discussed in #25837. I looked into this a bit à year ago, and it turns out the automatic_names implementation lives in sagenb. It needs to be moved into the main sage package, and will take some adjusting to integrate into the IPython terminal and Jupyter kernel interfaces.

@embray embray removed this from the sage-6.4 milestone Jul 14, 2019
@embray
Copy link
Contributor

embray commented Jul 14, 2019

comment:10

I thought I also made a ticket specifically for this issue but I can't find it now, so maybe this is just the one.

@kcrisman
Copy link
Member

comment:11

I've created #29888 for automatic_names in Jupyter.

This ticket can still be about differences between the terminal and Jupyter notebook, but probably should be updated for differences between that one and the terminal, not the sagenb and terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants