我是Python的新手,想知道Python(或IPython)是否与R中的invisible()函数等效。invisible()函数返回值,但如果以交互方式运行,则不显示它们,而是仅使它们可用进行分配。例如:
doStuff <- function(x) {
// blah blah
return(invisible(retValue))
}
z = doStuff(x) // z has the return value
doStuff(x) // retValue doesn't get displayed
Run Code Online (Sandbox Code Playgroud)