3

I'm given a task of converting an R script to Python. I'm trying to understand the functionality.

It is mentioned as below in the script.

stop('The database argument must be supplied', call.=FALSE)

Is this equal to Python's sys.exit? like

sys.exit('The database argument must be supplied')

And what is the meaning of call.=FALSE.

I have gone through R documentation but couldn't relate to Pythonic terms.

https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/stop

renatodvc
  • 2,526
  • 2
  • 6
  • 17
Underoos
  • 4,708
  • 8
  • 42
  • 85
  • I believe this would be similar to `raise Exception` https://stackoverflow.com/questions/2052390/manually-raising-throwing-an-exception-in-python – Matthew Barlowe Oct 26 '19 at 19:23
  • What does the `call.=FALSE` means. – Underoos Oct 26 '19 at 19:39
  • From the docs it determines whether the function call that raised the exception will be included in the error message. FALSE says that it will be not – Matthew Barlowe Oct 26 '19 at 19:42
  • I mean is there any such thing in Python? – Underoos Oct 26 '19 at 19:44
  • There is no flag in the `raise Exception` to specifically hide the traceback there are ways to do so in the `try ... except` block you would be using it in but without know more about your code I wouldn't know exactly what to tell you – Matthew Barlowe Oct 26 '19 at 19:54

0 Answers0