[Python-Dev] a quit that actually quits

Ronald Oussoren ronaldoussoren at mac.com
Tue Dec 27 17:40:20 CET 2005


On 27-dec-2005, at 16:39, Fredrik Lundh wrote:

> Ronald Oussoren wrote:
>
>> Why must quit and exit be so special in the first place? They could
>> be plain functions, or even something like::
>>
>> class _QuitOrExit:
>> def __init__(self, name):
>> self.name = name
>>
>> def __repr__(self):
>> return "Use %(name)s() to exit."%(self.__dict__)
>>
>> def __call__(self):
>> raise SystemExit
>>
>> quit = _QuitOrExit("quit")
>> exit = _QuitOrExit("exit")
>
> but now we're back to today's situation:
>
>>>> quit
>     'Use Ctrl-Z plus Return to exit.'
>
> which violates the basic "if you know what I mean, why the /!"&/&!//%¤
> don't you do what I say" usability rule.

I'd prefer 'def quit(): raise SystemExit', the class above just adds  
a message for someone that accidently got stuck in a python shell. I  
don't like the idea of making quit or exit special enough to cause  
side effects without parentheses, no other function does that. Anyone  
that knows how to program in Python should be able to guess that you  
have to use 'quit()' instead of 'quit'.

BTW. I do agree that the current situation is stupid.

Ronald
>
> </F>
>
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/ 
> ronaldoussoren%40mac.com



More information about the Python-Dev mailing list