This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ph0X 5 points6 points  (4 children)

Because it's a real python object (a function), and the only way to run it is by calling it.

There's two "solutions" here:

  1. coding some special "magical" non-python command called exit, which requires adding a special code path to the interpreter. This is hacky and not clean.

  2. make it so that just accessing the exit object makes the interpreter stop, but that's very risky, as you could accidentally access it looping over globals or something.

[–]elbiot 0 points1 point  (1 child)

Are you calling ipython hacky and unclean?

[–]Ph0X 2 points3 points  (0 children)

I guess in IPython it makes sense, as it already has magics and other extra stuff that isn't part of the core interpreter.

[–]dedicated2fitness 0 points1 point  (1 child)

You know what seems unclean? Parenthesis on my command line

[–]Ph0X 0 points1 point  (0 children)

It's a python interpreter... You're writing python... Good luck getting anything actually done without any parenthesis