sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.34k stars 453 forks source link

Do not print R NULL value #34378

Open novoselt opened 2 years ago

novoselt commented 2 years ago

As reported at https://github.com/sagemath/sagecell/issues/565

we currently have

sage: r.eval('cat("Hello, world!\n")')
Hello, world!
'<rpy2.rinterface_lib.sexp.NULLType object at 0x7ff05713c680> [RTYPES.NILSXP]'

and similar situation occurs for other cases where the last R command returns NULL. In Python such return values are not shown explicitly and it would be nice to catch them for R as well.

Component: interfaces

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

mkoeppe commented 2 years ago
comment:1

dup of #27025?

novoselt commented 2 years ago
comment:2

That ticket has more issues than this one. And I imagine this one is easier to fix and agree upon "the right way".

kcrisman commented 2 years ago
comment:3

Since we now use rpy2 rather than the custom thing we had a decade ago, that might be a little tougher. (But really just catching it there is probably the "easy, if not "right", way.) I remember NULL returns from various R commands for many years, so I don't think this is new. Sorry I can't help.