An autocallable object which will be added to the user namespace so that exit, exit(), quit or quit() are all valid ways to close the shell.
| 49 | |
| 50 | |
| 51 | class ExitAutocall(IPyAutocall): |
| 52 | """An autocallable object which will be added to the user namespace so that |
| 53 | exit, exit(), quit or quit() are all valid ways to close the shell.""" |
| 54 | rewrite = False |
| 55 | |
| 56 | def __call__(self): |
| 57 | self._ip.ask_exit() |
| 58 | |
| 59 | class ZMQExitAutocall(ExitAutocall): |
| 60 | """Exit IPython. Autocallable, so it needn't be explicitly called. |