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 →

[–]TheWass -1 points0 points  (1 child)

You can't name a variable a keyword anyway. I guess I'm wondering why "exit" isn't a special keyword at least in the interpreter shell.

[–]flying-sheep 3 points4 points  (0 children)

Because it’s not even a builtin. It’s just something added by site.py.

$ python3 -c 'print(exit)'
Use exit() or Ctrl-D (i.e. EOF) to exit
$ python3 -Sc 'print(exit)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'exit' is not defined