73

So you detected that I wrote quit but oh no instead of actually quitting I get to know I have to write quit()

Comments
  • 15
    Because "quit" wont work in a script.
  • 3
    @Cyanite But still, you aren't writing a script. I am not into python a lot, but I think the interactive shell should at least have an option for enabling quit
  • 7
    @Mitiko

    The Terminal had no Terminal-only commands.

    Everything works as if you were in a script.
  • 3
    The creator of RoR make a case for this in his manifesto entailing ruby and rails. I do get annoyed by it. But there is a good reason for it. Still, come on man you know what I meant and you still bitched about it. Meh, you can add the functionality yourself buy still. For a language as powerful and productive as python this really irks me.
  • 1
    I'm not sure why you're mad. This makes a lot of sense
  • 0
    Because there is code in there that knew what I wanted. Name is not defined had made me less annoyed.
  • 0
    Yep, try define something to p variable or s. It will just execute command or fail.

    Python is weird
  • 0
    Ctrl+D on Linux
  • 1
    class _quit():
    def __str__(self):
    return self.__repr__()
    def __repr__(self):
    return "Use quit() or Ctrl+C"
    def __call__(self):
    import sys
    sys.exit(0)
    quit = _quit()
    del _quit
  • 0
    I have seen similar messages in other software, and worse than these messages was talking to devs who wrote them and argued that that was the correct and intended behavior.
Add Comment